-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.1.0: self test is failing in testing/python/raises.py::TestRaises::test_raises_exception_looks_iterable
#9764
Comments
BTW .. SKIPPED [22] testing/test_nose.py:6: could not import 'nose': No module named 'nose' I think that this can be now removed as |
@kloczek I've corrected you on this before, but I'll happily do it again: nose is old, but it runs on Python 3 just fine. It's even mentioned right on their homepage. I have no idea where you're getting this from. |
Issue is that |
It breaks on Python 3.10 due to the |
IIRC [tkloczko@devel-g2v SPECS]$ grep "BUG.*nose" python-*
python-beaker.spec:# BUG: pytest is using outdated nose module https://github.com/bbangert/beaker/issues/218
python-billiard.spec:# BUG: uses nose https://github.com/celery/billiard/issues/337
python-blessings.spec:# BUG: uses nose https://github.com/erikrose/blessings/issues/164
python-boto.spec:# BUG: test suite is using nose https://github.com/boto/boto/issues/3932
python-colorspacious.spec:# BUG: test suite is using nose
python-cycler.spec:# BUG: replace nose by ptest https://github.com/matplotlib/cycler/issues/73
python-flaky.spec:# BUG: test suite uses outdated nose module https://github.com/box/flaky/issues/180
python-gitdb.spec:# BUG: test suite uses nose https://github.com/gitpython-developers/gitdb/issues/72
python-httpretty.spec:# BUG: still has some nose dependencies https://github.com/gabrielfalcao/HTTPretty/issues/439
python-ipython_genutils.spec:# BUG: pytest test suite is failing and is using nose https://github.com/ipython/ipython_genutils/issues/18
python-ipython.spec:# BUG: pytest warnings and test suite is using nose https://github.com/ipython/ipython/issues/13018
python-jsondiff.spec:# BUG: test suite is using nose-randomly https://github.com/xlwings/jsondiff/issues/44
python-parameterized.spec:# BUG: test suite is using nose https://github.com/wolever/parameterized/issues/122
python-pylibmc.spec:# BUG: test suite uses nose https://github.com/lericson/pylibmc/issues/275
python-pyutilib.spec:# BUG: test suite uses nose https://github.com/PyUtilib/pyutilib/issues/116
python-rdflib-sqlalchemy.spec:# BUG: test suite uses nose https://github.com/RDFLib/rdflib-sqlalchemy/issues/90
python-sure.spec:# BUG: test suite iuses nose https://github.com/gabrielfalcao/sure/issues/182
python-traittypes.spec:# BUG: test suite is using nose https://github.com/jupyter-widgets/traittypes/issues/46
python-vine.spec:# BUG: test suite uses case module which uses nose which is deprecated https://github.com/celery/vine/issues/61
python-zerorpc.spec:# BUG: test suite is using nose https://github.com/0rpc/zerorpc-python/issues/243
[tkloczko@devel-g2v SPECS]$ grep "BUG.*nose" python-* |wc -l
20 |
Just retested 7.1.3 and sttill I see failing |
Just FTR still see in just released 7.2.2 + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.4.2-2.fc35.x86_64/usr/bin/pytest -ra -m 'not network' --import-mode=importlib -p no:flaky -p no:randomly
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-7.4.2
configfile: pyproject.toml
testpaths: testing
plugins: xdist-3.3.1, hypothesis-6.82.0
collected 3465 items
testing/acceptance_test.py ..... [ 0%]
testing/deprecated_test.py ....... [ 0%]
testing/test_argcomplete.py .. [ 0%]
testing/test_assertion.py .............................................. [ 1%]
....................... [ 2%]
testing/test_assertrewrite.py .......................................... [ 3%]
.. [ 3%]
testing/test_capture.py ................................................ [ 5%]
........s....s.. [ 5%]
testing/test_collection.py . [ 5%]
testing/test_compat.py ........... [ 5%]
testing/test_config.py ................................................. [ 7%]
..... [ 7%]
testing/test_conftest.py ........... [ 7%]
testing/test_debugging.py . [ 7%]
testing/test_doctest.py ............. [ 8%]
testing/test_entry_points.py . [ 8%]
testing/test_faulthandler.py ... [ 8%]
testing/test_findpaths.py ..............s... [ 8%]
testing/test_helpconfig.py . [ 8%]
testing/test_junitxml.py .... [ 8%]
testing/test_legacypath.py .... [ 9%]
testing/test_main.py ..... [ 9%]
testing/test_mark.py .............. [ 9%]
testing/test_mark_expression.py ........................................ [ 10%]
............................................ [ 12%]
testing/test_monkeypatch.py ............................... [ 12%]
testing/test_nodes.py .............. [ 13%]
testing/test_nose.py ss [ 13%]
testing/test_parseopt.py ............................ [ 14%]
testing/test_pastebin.py .... [ 14%]
testing/test_pathlib.py .............................................s.. [ 15%]
...... [ 15%]
testing/test_pluginmanager.py ......... [ 16%]
testing/test_pytester.py ..................... [ 16%]
testing/test_recwarn.py ........................................ [ 17%]
testing/test_runner.py .............. [ 18%]
testing/test_scope.py .... [ 18%]
testing/test_skipping.py . [ 18%]
testing/test_stash.py . [ 18%]
testing/test_terminal.py ....................................... [ 19%]
testing/test_tmpdir.py ...s............... [ 20%]
testing/test_warning_types.py .............. [ 20%]
testing/test_warnings.py . [ 20%]
testing/_py/test_local.py .............................................. [ 21%]
...................ss..............s.................x......s........... [ 23%]
..........................sssssss............................x... [ 25%]
testing/code/test_code.py ................. [ 26%]
testing/code/test_excinfo.py ........................................... [ 27%]
........................................................................ [ 29%]
.............. [ 30%]
testing/code/test_source.py ............................................ [ 31%]
........... [ 31%]
testing/freeze/tests/test_trivial.py .. [ 31%]
testing/io/test_saferepr.py .............. [ 32%]
testing/io/test_terminalwriter.py ...................................... [ 33%]
....... [ 33%]
testing/io/test_wcwidth.py ................. [ 33%]
testing/logging/test_fixture.py .................. [ 34%]
testing/logging/test_formatter.py .... [ 34%]
testing/logging/test_reporting.py .. [ 34%]
testing/python/approx.py ............................................... [ 35%]
.................................. [ 36%]
testing/python/collect.py .. [ 36%]
testing/python/fixtures.py .......... [ 37%]
testing/python/integration.py .... [ 37%]
testing/python/metafunc.py ......................................... [ 38%]
testing/python/raises.py ...................F... [ 39%]
testing/freeze/tests/test_doctest.txt . [ 39%]
testing/acceptance_test.py ............................................. [ 40%]
.....x.................... [ 41%]
testing/deprecated_test.py ...........ss [ 41%]
testing/test_assertion.py ................................... [ 42%]
testing/test_assertrewrite.py .............s............................ [ 43%]
.................... [ 44%]
testing/test_cacheprovider.py .......................................... [ 45%]
............. [ 46%]
testing/test_capture.py ......x........................s........... [ 47%]
testing/test_collection.py ...........................x................. [ 48%]
.......................s................. [ 49%]
testing/test_compat.py .. [ 49%]
testing/test_config.py ...............x................................. [ 51%]
.............................................s.......................... [ 53%]
....... [ 53%]
testing/test_conftest.py .............s............................. [ 54%]
testing/test_debugging.py ............. [ 55%]
testing/test_doctest.py ................................................ [ 56%]
...............x........................................................ [ 58%]
.. [ 58%]
testing/test_error_diffs.py ............ [ 59%]
testing/test_faulthandler.py ... [ 59%]
testing/test_helpconfig.py ........ [ 59%]
testing/test_junitxml.py ............................................... [ 60%]
........................................................................ [ 62%]
....... [ 62%]
testing/test_legacypath.py .......... [ 63%]
testing/test_link_resolve.py . [ 63%]
testing/test_main.py .............. [ 63%]
testing/test_mark.py ................................................... [ 65%]
........x................ [ 65%]
testing/test_monkeypatch.py .... [ 66%]
testing/test_nodes.py .... [ 66%]
testing/test_nose.py ssssssssssssssssssssss [ 66%]
testing/test_parseopt.py s [ 66%]
testing/test_pastebin.py ... [ 66%]
testing/test_pluginmanager.py ................ [ 67%]
testing/test_pytester.py x......................... [ 68%]
testing/test_python_path.py ..... [ 68%]
testing/test_recwarn.py .. [ 68%]
testing/test_reports.py .................. [ 68%]
testing/test_runner.py .......................x..................... [ 70%]
testing/test_runner_xunit.py ............. [ 70%]
testing/test_session.py ........................ [ 71%]
testing/test_setuponly.py .......................... [ 71%]
testing/test_setupplan.py ... [ 72%]
testing/test_skipping.py ............................................... [ 73%]
............................................. [ 74%]
testing/test_stepwise.py .............. [ 75%]
testing/test_terminal.py ............................................... [ 76%]
....................................................................... [ 78%]
testing/test_threadexception.py .... [ 78%]
testing/test_tmpdir.py .................... [ 79%]
testing/test_unittest.py ............................................... [ 80%]
........................ [ 81%]
testing/test_unraisableexception.py .... [ 81%]
testing/test_warning_types.py . [ 81%]
testing/test_warnings.py ...................sss.......... [ 82%]
testing/code/test_excinfo.py ....sssssssss............... [ 83%]
testing/examples/test_issue519.py . [ 83%]
testing/logging/test_fixture.py ........ [ 83%]
testing/logging/test_reporting.py ...................................... [ 84%]
....... [ 84%]
testing/python/approx.py . [ 84%]
testing/python/collect.py .............................................. [ 86%]
............................. [ 86%]
testing/python/fixtures.py ............................................. [ 88%]
..........................x............................................. [ 90%]
......................................................... [ 91%]
testing/python/integration.py ............... [ 92%]
testing/python/metafunc.py ............................................. [ 93%]
............... [ 94%]
testing/python/raises.py ... [ 94%]
testing/python/show_fixtures_per_test.py ........ [ 94%]
testing/acceptance_test.py ..... [ 94%]
testing/test_assertion.py ............ [ 94%]
testing/test_assertrewrite.py ......... [ 95%]
testing/test_capture.py ........................ [ 95%]
testing/test_collection.py . [ 95%]
testing/test_compat.py . [ 95%]
testing/test_config.py .. [ 95%]
testing/test_debugging.py sssssssssss.ssssssssssssssss.sss....ssss.sss [ 97%]
testing/test_faulthandler.py ..s. [ 97%]
testing/test_helpconfig.py .. [ 97%]
testing/test_legacypath.py . [ 97%]
testing/test_meta.py ................................................... [ 98%]
................ [ 99%]
testing/test_pytester.py ....s [ 99%]
testing/test_reports.py . [ 99%]
testing/test_terminal.py ss.. [ 99%]
testing/test_unittest.py s. [ 99%]
testing/test_warnings.py ......... [ 99%]
testing/python/collect.py . [ 99%]
testing/python/fixtures.py x. [100%]
=================================== FAILURES ===================================
_______________ TestRaises.test_raises_exception_looks_iterable ________________
self = <testing.python.raises.TestRaises object at 0x7f78395f5a60>
def test_raises_exception_looks_iterable(self):
class Meta(type):
def __getitem__(self, item):
return 1 / 0
def __len__(self):
return 1
class ClassLooksIterableException(Exception, metaclass=Meta):
pass
with pytest.raises(
Failed,
match=r"DID NOT RAISE <class 'raises(\..*)*ClassLooksIterableException'>",
):
> pytest.raises(ClassLooksIterableException, lambda: None)
E Failed: DID NOT RAISE <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>
/home/tkloczko/rpmbuild/BUILD/pytest-7.4.2/testing/python/raises.py:264: Failed
During handling of the above exception, another exception occurred:
self = <testing.python.raises.TestRaises object at 0x7f78395f5a60>
def test_raises_exception_looks_iterable(self):
class Meta(type):
def __getitem__(self, item):
return 1 / 0
def __len__(self):
return 1
class ClassLooksIterableException(Exception, metaclass=Meta):
pass
with pytest.raises(
Failed,
match=r"DID NOT RAISE <class 'raises(\..*)*ClassLooksIterableException'>",
):
> pytest.raises(ClassLooksIterableException, lambda: None)
E AssertionError: Regex pattern did not match.
E Regex: "DID NOT RAISE <class 'raises(\\..*)*ClassLooksIterableException'>"
E Input: "DID NOT RAISE <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>"
/home/tkloczko/rpmbuild/BUILD/pytest-7.4.2/testing/python/raises.py:264: AssertionError
=========================== short test summary info ============================
SKIPPED [2] testing/test_capture.py:961: could not run 'lsof' (FileNotFoundError(2, 'No such file or directory'))
SKIPPED [1] testing/test_capture.py:1447: only on windows
SKIPPED [1] testing/test_findpaths.py:140: condition: sys.platform != 'win32'
SKIPPED [24] testing/test_nose.py:6: could not import 'nose': No module named 'nose'
SKIPPED [1] testing/test_pathlib.py:458: Windows only
SKIPPED [1] testing/test_tmpdir.py:361: win only
SKIPPED [1] testing/_py/test_local.py:462: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:467: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:667: case insensitive only on windows
SKIPPED [1] testing/_py/test_local.py:885: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1237: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1243: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1255: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1261: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1266: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1274: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1281: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/deprecated_test.py:286: could not import 'nose': No module named 'nose'
SKIPPED [1] testing/deprecated_test.py:315: could not import 'nose': No module named 'nose'
SKIPPED [1] testing/test_assertrewrite.py:773: importlib.resources.files was introduced in 3.9
SKIPPED [1] ../../BUILDROOT/python-pytest-7.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pathlib.py:466: symlinks not supported: [Errno 17] File exists: '/tmp/pytest-of-tkloczko/pytest-25/test_collect_symlink_dir0/symlink_dir' -> '/tmp/pytest-of-tkloczko/pytest-25/test_collect_symlink_dir0/dir'
SKIPPED [1] testing/test_config.py:1894: does not work with xdist currently
SKIPPED [1] testing/test_conftest.py:374: only relevant for case insensitive file systems
SKIPPED [1] testing/test_parseopt.py:336: argcomplete not available
SKIPPED [3] testing/test_warnings.py:521: not relevant until pytest 8.0
SKIPPED [9] testing/code/test_excinfo.py:1573: Native ExceptionGroup not implemented
SKIPPED [41] ../../BUILDROOT/python-pytest-7.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pytester.py:1536: could not import 'pexpect': No module named 'pexpect'
SKIPPED [1] testing/test_faulthandler.py:71: sometimes crashes on CI (#7022)
XFAIL testing/_py/test_local.py::TestLocalPath::test_long_filenames - reason: [NOTRUN] unreliable est for long filenames
XFAIL testing/_py/test_local.py::TestUnicodePy2Py3::test_read_write - changing read/write might break existing usages
XFAIL testing/acceptance_test.py::TestInvocationVariants::test_noclass_discovery_if_not_testcase - decide: feature or bug
XFAIL testing/test_capture.py::TestPerTestCapturing::test_capture_scope_cache - unimplemented feature
XFAIL testing/test_collection.py::TestPrunetraceback::test_collect_report_postprocessing - other mechanism for adding to reporting needed
XFAIL testing/test_config.py::TestParseIni::test_confcutdir - probably not needed
XFAIL testing/test_doctest.py::TestLiterals::test_number_non_matches['3.1416'-'3.14']
XFAIL testing/test_mark.py::TestKeywordSelection::test_keyword_extra_dash
XFAIL testing/test_pytester.py::test_make_hook_recorder - reason: internal reportrecorder tests need refactoring
XFAIL testing/test_runner.py::test_runtest_in_module_ordering
XFAIL testing/python/fixtures.py::TestAutouseDiscovery::test_setup_enabled_functionnode - 'enabled' feature not implemented
XFAIL testing/python/fixtures.py::TestRequestBasic::test_request_garbage - reason: this test is flaky when executed with xdist
FAILED testing/python/raises.py::TestRaises::test_raises_exception_looks_iterable
===== 1 failed, 3350 passed, 102 skipped, 12 xfailed in 207.38s (0:03:27) ====== |
Closing as not planned |
Hmm what in this case means "not planned"? 🤔 |
Based on the surrounding issues and prior issues, this is a artifact of how your particular packaging pipeline works |
So it "cannot be reproduced" and has nothing to do with "not planned" 🤔 |
a detailed description of the bug or problem you are having
I'm packaging pytest module as the rpm package using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
install .whl file in </install/prefix>
run pytest from </install/prefix> with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
output of
pip list
from the virtual environment you are usingpytest 7.1.0, Linux x85/64, python 3.8.12
The text was updated successfully, but these errors were encountered: