Skip to content
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.2.0: pytest self test is failing #10443

Closed
4 tasks done
kloczek opened this issue Oct 27, 2022 · 4 comments
Closed
4 tasks done

7.2.0: pytest self test is failing #10443

kloczek opened this issue Oct 27, 2022 · 4 comments

Comments

@kloczek
Copy link
Contributor

kloczek commented Oct 27, 2022

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

OS: Linux x86/64

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is list of installed modules in build env

Package                        Version
------------------------------ -----------------
alabaster                      0.7.12
appdirs                        1.4.4
asynctest                      0.13.0
attrs                          22.1.0
Automat                        20.2.0
Babel                          2.10.2
Brlapi                         0.8.3
build                          0.8.0
charset-normalizer             3.0.0
codespell                      2.2.1
constantly                     15.1.0
cssselect                      1.1.0
decorator                      5.1.1
distro                         1.7.0
dnspython                      2.2.1
docutils                       0.18.1
elementpath                    3.0.2
exceptiongroup                 1.0.0
execnet                        1.9.0
extras                         1.0.0
fixtures                       4.0.0
gpg                            1.17.1-unknown
hyperlink                      21.0.0
hypothesis                     6.41.0
idna                           3.4
imagesize                      1.4.1
importlib-metadata             5.0.0
incremental                    21.3.0
iniconfig                      1.1.1
Jinja2                         3.1.1
libcomps                       0.1.19
louis                          3.23.0
lxml                           4.9.1
MarkupSafe                     2.1.1
mock                           4.0.3
numpy                          1.23.1
packaging                      21.3
Pallets-Sphinx-Themes          2.0.2
pbr                            5.9.0
pep517                         0.13.0
pip                            22.2.2
pluggy                         1.0.0
py                             1.11.0
Pygments                       2.13.0
pygments-pytest                2.2.0
PyGObject                      3.42.2
pyparsing                      3.0.9
pytest                         7.1.3
pytest-forked                  1.4.0
pytest-xdist                   2.5.0
python-dateutil                2.8.2
pytz                           2022.4
requests                       2.28.1
rpm                            4.17.0
scour                          0.38.2
setuptools                     65.5.0
setuptools-scm                 7.0.5
six                            1.16.0
snowballstemmer                2.2.0
sortedcontainers               2.4.0
Sphinx                         5.3.0
sphinx-removed-in              0.2.1
sphinxcontrib-applehelp        1.0.2.dev20220730
sphinxcontrib-devhelp          1.0.2.dev20220730
sphinxcontrib-htmlhelp         2.0.0
sphinxcontrib-jsmath           1.0.1.dev20220730
sphinxcontrib-qthelp           1.0.3.dev20220730
sphinxcontrib-serializinghtml  1.1.5
sphinxcontrib-svg2pdfconverter 1.2.0
sphinxcontrib-trio             1.1.2
testtools                      2.5.0
tomli                          2.0.1
Twisted                        22.8.0
typing_extensions              4.3.0
urllib3                        1.26.12
wheel                          0.37.1
xmlschema                      2.1.1
zipp                           3.9.0
zope.event                     4.5.0
zope.interface                 5.5.0
@kloczek
Copy link
Contributor Author

kloczek commented Oct 27, 2022

Here is pytest output:

+ PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/bin:/usr/bin:/usr/sbin:/usr/local/sbin
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/bin/pytest -ra --import-mode=importlib -p no:flaky -p no:randomly --deselect testing/python/raises.py::TestRaises::test_raises_exception_looks_iterable
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-7.2.0, configfile: pyproject.toml, testpaths: testing
plugins: forked-1.4.0, xdist-2.5.0, hypothesis-6.41.0
collected 3380 items / 1 deselected / 3379 selected

testing/acceptance_test.py .....                                                                                                                                     [  0%]
testing/deprecated_test.py .......                                                                                                                                   [  0%]
testing/test_argcomplete.py ..                                                                                                                                       [  0%]
testing/test_assertion.py ..................................................................                                                                         [  2%]
testing/test_assertrewrite.py ............................................                                                                                           [  3%]
testing/test_capture.py .............................................................s..                                                                             [  5%]
testing/test_collection.py .                                                                                                                                         [  5%]
testing/test_compat.py ...........                                                                                                                                   [  5%]
testing/test_config.py ......................................................                                                                                        [  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 ..............                                                                                                                             [  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 ....................................................................................                                                 [ 12%]
testing/test_monkeypatch.py ...............................                                                                                                          [ 13%]
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%]
testing/test_pluginmanager.py .........                                                                                                                              [ 16%]
testing/test_pytester.py .....................                                                                                                                       [ 16%]
testing/test_recwarn.py ........................................                                                                                                     [ 18%]
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 .................................................................ss..............s.................x......s............................... [ 24%]
......sssssss............................x...                                                                                                                        [ 26%]
testing/code/test_code.py .................                                                                                                                          [ 26%]
testing/code/test_excinfo.py ..............................................................................................................................          [ 30%]
testing/code/test_source.py .......................................................                                                                                  [ 32%]
testing/freeze/tests/test_trivial.py ..                                                                                                                              [ 32%]
testing/io/test_saferepr.py ..............                                                                                                                           [ 32%]
testing/io/test_terminalwriter.py .............................................                                                                                      [ 33%]
testing/io/test_wcwidth.py .................                                                                                                                         [ 34%]
testing/logging/test_fixture.py .........                                                                                                                            [ 34%]
testing/logging/test_formatter.py ....                                                                                                                               [ 34%]
testing/logging/test_reporting.py ..                                                                                                                                 [ 34%]
testing/python/approx.py ................................................................................                                                            [ 37%]
testing/python/collect.py ..                                                                                                                                         [ 37%]
testing/python/fixtures.py ..........                                                                                                                                [ 37%]
testing/python/integration.py ....                                                                                                                                   [ 37%]
testing/python/metafunc.py .........................................                                                                                                 [ 38%]
testing/python/raises.py ......................                                                                                                                      [ 39%]
testing/freeze/tests/test_doctest.txt .                                                                                                                              [ 39%]
testing/acceptance_test.py ..................................................x....................                                                                   [ 41%]
testing/deprecated_test.py ...........ss                                                                                                                             [ 41%]
testing/test_assertion.py ...................................                                                                                                        [ 43%]
testing/test_assertrewrite.py .............s...............................                                                                                          [ 44%]
testing/test_cacheprovider.py ...................................................                                                                                    [ 45%]
testing/test_capture.py ......x....................................                                                                                                  [ 47%]
testing/test_collection.py ...........................x.....................................s.................                                                       [ 49%]
testing/test_compat.py ..                                                                                                                                            [ 49%]
testing/test_config.py .............x..............................................................................s.................................                [ 53%]
testing/test_conftest.py .............s.............................                                                                                                 [ 54%]
testing/test_debugging.py .............                                                                                                                              [ 55%]
testing/test_doctest.py ..............................................................x..........................................................                    [ 58%]
testing/test_error_diffs.py ............                                                                                                                             [ 58%]
testing/test_faulthandler.py ...                                                                                                                                     [ 59%]
testing/test_helpconfig.py ........                                                                                                                                  [ 59%]
testing/test_junitxml.py .................................................................................................F...F.......................               [ 63%]
testing/test_legacypath.py ..........                                                                                                                                [ 63%]
testing/test_link_resolve.py .                                                                                                                                       [ 63%]
testing/test_main.py .............                                                                                                                                   [ 63%]
testing/test_mark.py ...........................................................x................                                                                    [ 65%]
testing/test_monkeypatch.py ....                                                                                                                                     [ 66%]
testing/test_nodes.py ....                                                                                                                                           [ 66%]
testing/test_nose.py ssssssssssssssssssss                                                                                                                            [ 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 ..........................                                                                                                                 [ 72%]
testing/test_setupplan.py ...                                                                                                                                        [ 72%]
testing/test_skipping.py ...........................................................................................                                                 [ 74%]
testing/test_stepwise.py ............                                                                                                                                [ 75%]
testing/test_terminal.py ..............................................F....................................................FFF.....F......                          [ 78%]
testing/test_threadexception.py ....                                                                                                                                 [ 78%]
testing/test_tmpdir.py ................                                                                                                                              [ 79%]
testing/test_unittest.py .......................................................................                                                                     [ 81%]
testing/test_unraisableexception.py ....                                                                                                                             [ 81%]
testing/test_warning_types.py .                                                                                                                                      [ 81%]
testing/test_warnings.py ...................sss.........                                                                                                             [ 82%]
testing/code/test_excinfo.py ....sssssssss.........                                                                                                                  [ 82%]
testing/examples/test_issue519.py .                                                                                                                                  [ 82%]
testing/logging/test_fixture.py .......                                                                                                                              [ 83%]
testing/logging/test_reporting.py ......................................                                                                                             [ 84%]
testing/python/approx.py .                                                                                                                                           [ 84%]
testing/python/collect.py ...........................................................................                                                                [ 86%]
testing/python/fixtures.py .......................................................................x................................................................. [ 90%]
....................................                                                                                                                                 [ 91%]
testing/python/integration.py ...............                                                                                                                        [ 92%]
testing/python/metafunc.py ............................................................                                                                              [ 93%]
testing/python/raises.py ...                                                                                                                                         [ 93%]
testing/python/show_fixtures_per_test.py ........                                                                                                                    [ 94%]
testing/acceptance_test.py ....                                                                                                                                      [ 94%]
testing/test_assertion.py ............                                                                                                                               [ 94%]
testing/test_assertrewrite.py .........                                                                                                                              [ 94%]
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 ...................................................................                                                                             [ 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 =================================================================================
_______________________________________________________________________ test_random_report_log_xdist _______________________________________________________________________

pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_random_report_log_xdist0')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0688514550>
run_and_parse = <testing.test_junitxml.RunAndParse object at 0x7f06807297f0>

    def test_random_report_log_xdist(
        pytester: Pytester, monkeypatch: MonkeyPatch, run_and_parse: RunAndParse
    ) -> None:
        """`xdist` calls pytest_runtest_logreport as they are executed by the workers,
        with nodes from several nodes overlapping, so junitxml must cope with that
        to produce correct reports (#1064)."""
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
        pytester.makepyfile(
            """
            import pytest, time
            @pytest.mark.parametrize('i', list(range(30)))
            def test_x(i):
                assert i != 22
        """
        )
>       _, dom = run_and_parse("-n2")

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_junitxml.py:1354:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_junitxml.py:50: in __call__
    xmldoc = minidom.parse(str(xml_path))
/usr/lib64/python3.8/xml/dom/minidom.py:1959: in parse
    return expatbuilder.parse(file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file = '/tmp/pytest-of-tkloczko/pytest-59/test_random_report_log_xdist0/junit.xml', namespaces = True

    def parse(file, namespaces=True):
        """Parse a document, returning the resulting Document node.

        'file' may be either a file name or an open file object.
        """
        if namespaces:
            builder = ExpatBuilderNS()
        else:
            builder = ExpatBuilder()

        if isinstance(file, str):
>           with open(file, 'rb') as fp:
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-59/test_random_report_log_xdist0/junit.xml'

/usr/lib64/python3.8/xml/dom/expatbuilder.py:910: FileNotFoundError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
__________________________________________________________________________ test_runs_twice_xdist ___________________________________________________________________________

pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_runs_twice_xdist0')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0680a2be50>
run_and_parse = <testing.test_junitxml.RunAndParse object at 0x7f0680bd3df0>

    def test_runs_twice_xdist(
        pytester: Pytester, monkeypatch: MonkeyPatch, run_and_parse: RunAndParse
    ) -> None:
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
        f = pytester.makepyfile(
            """
            def test_pass():
                pass
        """
        )

>       result, dom = run_and_parse(f, "--dist", "each", "--tx", "2*popen")

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_junitxml.py:1407:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_junitxml.py:50: in __call__
    xmldoc = minidom.parse(str(xml_path))
/usr/lib64/python3.8/xml/dom/minidom.py:1959: in parse
    return expatbuilder.parse(file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file = '/tmp/pytest-of-tkloczko/pytest-59/test_runs_twice_xdist0/junit.xml', namespaces = True

    def parse(file, namespaces=True):
        """Parse a document, returning the resulting Document node.

        'file' may be either a file name or an open file object.
        """
        if namespaces:
            builder = ExpatBuilderNS()
        else:
            builder = ExpatBuilder()

        if isinstance(file, str):
>           with open(file, 'rb') as fp:
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-59/test_runs_twice_xdist0/junit.xml'

/usr/lib64/python3.8/xml/dom/expatbuilder.py:910: FileNotFoundError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
___________________________________________________________ TestTerminalFunctional.test_verbose_reporting_xdist ____________________________________________________________

self = <testing.test_terminal.TestTerminalFunctional object at 0x7f06920c2c10>
verbose_testfile = PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_verbose_reporting_xdist0/test_verbose_reporting_xdist.py')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f06809f99d0>, pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_verbose_reporting_xdist0')>
pytestconfig = <_pytest.config.Config object at 0x7f069343de20>

    def test_verbose_reporting_xdist(
        self,
        verbose_testfile,
        monkeypatch: MonkeyPatch,
        pytester: Pytester,
        pytestconfig,
    ) -> None:
        if not pytestconfig.pluginmanager.get_plugin("xdist"):
            pytest.skip("xdist plugin not installed")

        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
        result = pytester.runpytest(
            verbose_testfile, "-v", "-n 1", "-Walways::pytest.PytestWarning"
        )
>       result.stdout.fnmatch_lines(
            ["*FAIL*test_verbose_reporting_xdist.py::test_fail*"]
        )
E       Failed: nomatch: '*FAIL*test_verbose_reporting_xdist.py::test_fail*'
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session'
E           and: 'INTERNALERROR>     config._do_configure()'
E           and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure'
E           and: 'INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic'
E           and: 'INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure'
E           and: 'INTERNALERROR>     from xdist.dsession import DSession'
E           and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E           and: 'INTERNALERROR>     exec(co, module.__dict__)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>'
E           and: 'INTERNALERROR>     from xdist.scheduler import ('
E           and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E           and: 'INTERNALERROR>     exec(co, module.__dict__)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>'
E           and: 'INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa'
E           and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E           and: 'INTERNALERROR>     exec(co, module.__dict__)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>'
E           and: 'INTERNALERROR>     from py.log import Producer'
E           and: "INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package"
E       remains unmatched: '*FAIL*test_verbose_reporting_xdist.py::test_fail*'

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_terminal.py:1084: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
________________________________________________________________ TestProgressOutputStyle.test_xdist_normal _________________________________________________________________

self = <testing.test_terminal.TestProgressOutputStyle object at 0x7f06920c7f70>, many_tests_files = None
pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_xdist_normal0')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f068090b880>

    def test_xdist_normal(
        self, many_tests_files, pytester: Pytester, monkeypatch
    ) -> None:
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
        output = pytester.runpytest("-n2")
>       output.stdout.re_match_lines([r"\.{20} \s+ \[100%\]"])
E       Failed:  nomatch: '\\.{20} \\s+ \\[100%\\]'
E            and: 'INTERNALERROR> Traceback (most recent call last):'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session'
E            and: 'INTERNALERROR>     config._do_configure()'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure'
E            and: 'INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic'
E            and: 'INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec'
E            and: 'INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall'
E            and: 'INTERNALERROR>     return outcome.get_result()'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result'
E            and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall'
E            and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure'
E            and: 'INTERNALERROR>     from xdist.dsession import DSession'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler import ('
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from py.log import Producer'
E            and: "INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package"
E       remains unmatched: '\\.{20} \\s+ \\[100%\\]'

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_terminal.py:2161: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
_____________________________________________________________ TestProgressOutputStyle.test_xdist_normal_count ______________________________________________________________

self = <testing.test_terminal.TestProgressOutputStyle object at 0x7f06920c7dc0>, many_tests_files = None
pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_xdist_normal_count0')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f04fbdfab20>

    def test_xdist_normal_count(
        self, many_tests_files, pytester: Pytester, monkeypatch
    ) -> None:
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
        pytester.makeini(
            """
            [pytest]
            console_output_style = count
        """
        )
        output = pytester.runpytest("-n2")
>       output.stdout.re_match_lines([r"\.{20} \s+ \[20/20\]"])
E       Failed:  nomatch: '\\.{20} \\s+ \\[20/20\\]'
E            and: 'INTERNALERROR> Traceback (most recent call last):'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session'
E            and: 'INTERNALERROR>     config._do_configure()'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure'
E            and: 'INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic'
E            and: 'INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec'
E            and: 'INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall'
E            and: 'INTERNALERROR>     return outcome.get_result()'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result'
E            and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall'
E            and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure'
E            and: 'INTERNALERROR>     from xdist.dsession import DSession'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler import ('
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from py.log import Producer'
E            and: "INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package"
E       remains unmatched: '\\.{20} \\s+ \\[20/20\\]'

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_terminal.py:2175: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
________________________________________________________________ TestProgressOutputStyle.test_xdist_verbose ________________________________________________________________

self = <testing.test_terminal.TestProgressOutputStyle object at 0x7f06920c7250>, many_tests_files = None
pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_xdist_verbose0')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0688981e80>

    def test_xdist_verbose(
        self, many_tests_files, pytester: Pytester, monkeypatch
    ) -> None:
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
        output = pytester.runpytest("-n2", "-v")
>       output.stdout.re_match_lines_random(
            [
                r"\[gw\d\] \[\s*\d+%\] PASSED test_bar.py::test_bar\[1\]",
                r"\[gw\d\] \[\s*\d+%\] PASSED test_foo.py::test_foo\[1\]",
                r"\[gw\d\] \[\s*\d+%\] PASSED test_foobar.py::test_foobar\[1\]",
            ]
        )
E       Failed: line '\\[gw\\d\\] \\[\\s*\\d+%\\] PASSED test_bar.py::test_bar\\[1\\]' not found in output

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_terminal.py:2183: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
________________________________________________________________ TestProgressWithTeardown.test_xdist_normal ________________________________________________________________

self = <testing.test_terminal.TestProgressWithTeardown object at 0x7f0691eae190>, many_files = None
pytester = <Pytester PosixPath('/tmp/pytest-of-tkloczko/pytest-59/test_xdist_normal1')>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0681927ee0>

    def test_xdist_normal(self, many_files, pytester: Pytester, monkeypatch) -> None:
        pytest.importorskip("xdist")
        monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
        output = pytester.runpytest("-n2")
>       output.stdout.re_match_lines([r"[\.E]{40} \s+ \[100%\]"])
E       Failed:  nomatch: '[\\.E]{40} \\s+ \\[100%\\]'
E            and: 'INTERNALERROR> Traceback (most recent call last):'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session'
E            and: 'INTERNALERROR>     config._do_configure()'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure'
E            and: 'INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic'
E            and: 'INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec'
E            and: 'INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall'
E            and: 'INTERNALERROR>     return outcome.get_result()'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result'
E            and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall'
E            and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure'
E            and: 'INTERNALERROR>     from xdist.dsession import DSession'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler import ('
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa'
E            and: 'INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module'
E            and: 'INTERNALERROR>     exec(co, module.__dict__)'
E            and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>'
E            and: 'INTERNALERROR>     from py.log import Producer'
E            and: "INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package"
E       remains unmatched: '[\\.E]{40} \\s+ \\[100%\\]'

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/test_terminal.py:2307: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR>     from xdist.dsession import DSession
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR>     from xdist.scheduler import (
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR>     from xdist.scheduler.each import EachScheduling  # noqa
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/xdist/scheduler/each.py", line 1, in <module>
INTERNALERROR>     from py.log import Producer
INTERNALERROR> ModuleNotFoundError: No module named 'py.log'; 'py' is not a package
========================================================================= short test summary info ==========================================================================
SKIPPED [1] testing/test_capture.py:1441: only on windows
SKIPPED [22] testing/test_nose.py:6: could not import 'nose': No module named 'nose'
SKIPPED [1] testing/test_pathlib.py:442: Windows only
SKIPPED [1] testing/test_tmpdir.py:221: win only
SKIPPED [1] testing/_py/test_local.py:449: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:454: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:650: case insensitive only on windows
SKIPPED [1] testing/_py/test_local.py:868: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1220: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1226: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1238: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1244: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1249: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1257: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1264: 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:770: importlib.resources.files was introduced in 3.9
SKIPPED [1] ../../BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pathlib.py:434: symlinks not supported: [Errno 17] File exists: '/tmp/pytest-of-tkloczko/pytest-59/test_collect_symlink_dir0/symlink_dir' -> '/tmp/pytest-of-tkloczko/pytest-59/test_collect_symlink_dir0/dir'
SKIPPED [1] testing/test_config.py:1857: does not work with xdist currently
SKIPPED [1] testing/test_conftest.py:361: only relevant for case insensitive file systems
SKIPPED [1] testing/test_parseopt.py:330: argcomplete not available
SKIPPED [3] testing/test_warnings.py:521: not relevant until pytest 8.0
SKIPPED [9] testing/code/test_excinfo.py:1545: Native ExceptionGroup not implemented
SKIPPED [41] ../../BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pytester.py:1534: 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/test_junitxml.py::test_random_report_log_xdist - FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-59/test_random_report_log_xdist0/junit.xml'
FAILED testing/test_junitxml.py::test_runs_twice_xdist - FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-tkloczko/pytest-59/test_runs_twice_xdist0/junit.xml'
FAILED testing/test_terminal.py::TestTerminalFunctional::test_verbose_reporting_xdist - Failed: nomatch: '*FAIL*test_verbose_reporting_xdist.py::test_fail*'
FAILED testing/test_terminal.py::TestProgressOutputStyle::test_xdist_normal - Failed:  nomatch: '\\.{20} \\s+ \\[100%\\]'
FAILED testing/test_terminal.py::TestProgressOutputStyle::test_xdist_normal_count - Failed:  nomatch: '\\.{20} \\s+ \\[20/20\\]'
FAILED testing/test_terminal.py::TestProgressOutputStyle::test_xdist_verbose - Failed: line '\\[gw\\d\\] \\[\\s*\\d+%\\] PASSED test_bar.py::test_bar\\[1\\]' not found in output
FAILED testing/test_terminal.py::TestProgressWithTeardown::test_xdist_normal - Failed:  nomatch: '[\\.E]{40} \\s+ \\[100%\\]'
============================================= 7 failed, 3263 passed, 97 skipped, 1 deselected, 12 xfailed in 188.78s (0:03:08) =============================================

@The-Compiler
Copy link
Member

This is due to a bug in the old xdist version you use. See pytest-dev/pytest-xdist#822.

@The-Compiler The-Compiler closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
@kloczek
Copy link
Contributor Author

kloczek commented Oct 27, 2022

Just retested against latest xdist 3.0.2 and indeed looks like some units hve been failing because xdist however one unit still is failing.

================================================================================= FAILURES =================================================================================
_____________________________________________________________ TestRaises.test_raises_exception_looks_iterable ______________________________________________________________

self = <testing.python.raises.TestRaises object at 0x7f16a5e2d8e0>

    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)

/home/tkloczko/rpmbuild/BUILD/pytest-7.2.0/testing/python/raises.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

expected_exception = <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>
args = (<function TestRaises.test_raises_exception_looks_iterable.<locals>.<lambda> at 0x7f169d83bdc0>,), kwargs = {}, __tracebackhide__ = True
excepted_exceptions = (<class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>,)
exc = <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>
message = "DID NOT RAISE <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>"
func = <function TestRaises.test_raises_exception_looks_iterable.<locals>.<lambda> at 0x7f169d83bdc0>

    def raises(  # noqa: F811
        expected_exception: Union[Type[E], Tuple[Type[E], ...]], *args: Any, **kwargs: Any
    ) -> Union["RaisesContext[E]", _pytest._code.ExceptionInfo[E]]:
        r"""Assert that a code block/function call raises an exception.

        :param typing.Type[E] | typing.Tuple[typing.Type[E], ...] expected_exception:
            The excpected exception type, or a tuple if one of multiple possible
            exception types are excepted.
        :kwparam str | typing.Pattern[str] | None match:
            If specified, a string containing a regular expression,
            or a regular expression object, that is tested against the string
            representation of the exception using :func:`re.search`.

            To match a literal string that may contain :ref:`special characters
            <re-syntax>`, the pattern can first be escaped with :func:`re.escape`.

            (This is only used when :py:func:`pytest.raises` is used as a context manager,
            and passed through to the function otherwise.
            When using :py:func:`pytest.raises` as a function, you can use:
            ``pytest.raises(Exc, func, match="passed on").match("my pattern")``.)

        .. currentmodule:: _pytest._code

        Use ``pytest.raises`` as a context manager, which will capture the exception of the given
        type::

            >>> import pytest
            >>> with pytest.raises(ZeroDivisionError):
            ...    1/0

        If the code block does not raise the expected exception (``ZeroDivisionError`` in the example
        above), or no exception at all, the check will fail instead.

        You can also use the keyword argument ``match`` to assert that the
        exception matches a text or regex::

            >>> with pytest.raises(ValueError, match='must be 0 or None'):
            ...     raise ValueError("value must be 0 or None")

            >>> with pytest.raises(ValueError, match=r'must be \d+$'):
            ...     raise ValueError("value must be 42")

        The context manager produces an :class:`ExceptionInfo` object which can be used to inspect the
        details of the captured exception::

            >>> with pytest.raises(ValueError) as exc_info:
            ...     raise ValueError("value must be 42")
            >>> assert exc_info.type is ValueError
            >>> assert exc_info.value.args[0] == "value must be 42"

        .. note::

           When using ``pytest.raises`` as a context manager, it's worthwhile to
           note that normal context manager rules apply and that the exception
           raised *must* be the final line in the scope of the context manager.
           Lines of code after that, within the scope of the context manager will
           not be executed. For example::

               >>> value = 15
               >>> with pytest.raises(ValueError) as exc_info:
               ...     if value > 10:
               ...         raise ValueError("value must be <= 10")
               ...     assert exc_info.type is ValueError  # this will not execute

           Instead, the following approach must be taken (note the difference in
           scope)::

               >>> with pytest.raises(ValueError) as exc_info:
               ...     if value > 10:
               ...         raise ValueError("value must be <= 10")
               ...
               >>> assert exc_info.type is ValueError

        **Using with** ``pytest.mark.parametrize``

        When using :ref:`pytest.mark.parametrize ref`
        it is possible to parametrize tests such that
        some runs raise an exception and others do not.

        See :ref:`parametrizing_conditional_raising` for an example.

        **Legacy form**

        It is possible to specify a callable by passing a to-be-called lambda::

            >>> raises(ZeroDivisionError, lambda: 1/0)
            <ExceptionInfo ...>

        or you can specify an arbitrary callable with arguments::

            >>> def f(x): return 1/x
            ...
            >>> raises(ZeroDivisionError, f, 0)
            <ExceptionInfo ...>
            >>> raises(ZeroDivisionError, f, x=0)
            <ExceptionInfo ...>

        The form above is fully supported but discouraged for new code because the
        context manager form is regarded as more readable and less error-prone.

        .. note::
            Similar to caught exception objects in Python, explicitly clearing
            local references to returned ``ExceptionInfo`` objects can
            help the Python interpreter speed up its garbage collection.

            Clearing those references breaks a reference cycle
            (``ExceptionInfo`` --> caught exception --> frame stack raising
            the exception --> current frame stack --> local variables -->
            ``ExceptionInfo``) which makes Python keep all objects referenced
            from that cycle (including all local variables in the current
            frame) alive until the next cyclic garbage collection run.
            More detailed information can be found in the official Python
            documentation for :ref:`the try statement <python:try>`.
        """
        __tracebackhide__ = True

        if not expected_exception:
            raise ValueError(
                f"Expected an exception type or a tuple of exception types, but got `{expected_exception!r}`. "
                f"Raising exceptions is already understood as failing the test, so you don't need "
                f"any special code to say 'this should never raise an exception'."
            )
        if isinstance(expected_exception, type):
            excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,)
        else:
            excepted_exceptions = expected_exception
        for exc in excepted_exceptions:
            if not isinstance(exc, type) or not issubclass(exc, BaseException):
                msg = "expected exception must be a BaseException type, not {}"  # type: ignore[unreachable]
                not_a = exc.__name__ if isinstance(exc, type) else type(exc).__name__
                raise TypeError(msg.format(not_a))

        message = f"DID NOT RAISE {expected_exception}"

        if not args:
            match: Optional[Union[str, Pattern[str]]] = kwargs.pop("match", None)
            if kwargs:
                msg = "Unexpected keyword arguments passed to pytest.raises: "
                msg += ", ".join(sorted(kwargs))
                msg += "\nUse context-manager form instead?"
                raise TypeError(msg)
            return RaisesContext(expected_exception, message, match)
        else:
            func = args[0]
            if not callable(func):
                raise TypeError(f"{func!r} object (type: {type(func)}) must be callable")
            try:
                func(*args[1:], **kwargs)
            except expected_exception as e:
                # We just caught the exception - there is a traceback.
                assert e.__traceback__ is not None
                return _pytest._code.ExceptionInfo.from_exc_info(
                    (type(e), e, e.__traceback__)
                )
>       fail(message)

/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/python_api.py:952:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

reason = "DID NOT RAISE <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>", pytrace = True, msg = None

    @_with_exception(Failed)
    def fail(reason: str = "", pytrace: bool = True, msg: Optional[str] = None) -> NoReturn:
        """Explicitly fail an executing test with the given message.

        :param reason:
            The message to show the user as reason for the failure.

        :param pytrace:
            If False, msg represents the full failure information and no
            python traceback will be reported.

        :param msg:
            Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.
        """
        __tracebackhide__ = True
        reason = _resolve_msg_to_reason("fail", reason, msg)
>       raise Failed(msg=reason, pytrace=pytrace)
E       Failed: DID NOT RAISE <class 'testing.python.raises.TestRaises.test_raises_exception_looks_iterable.<locals>.ClassLooksIterableException'>

/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/outcomes.py:194: Failed

During handling of the above exception, another exception occurred:

self = <testing.python.raises.TestRaises object at 0x7f16a5e2d8e0>

    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.2.0/testing/python/raises.py:264: AssertionError
========================================================================= short test summary info ==========================================================================
SKIPPED [1] testing/test_capture.py:1441: only on windows
SKIPPED [22] testing/test_nose.py:6: could not import 'nose': No module named 'nose'
SKIPPED [1] testing/test_pathlib.py:442: Windows only
SKIPPED [1] testing/test_tmpdir.py:221: win only
SKIPPED [1] testing/_py/test_local.py:449: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:454: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:650: case insensitive only on windows
SKIPPED [1] testing/_py/test_local.py:868: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1220: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1226: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1238: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1244: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1249: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1257: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1264: 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:770: importlib.resources.files was introduced in 3.9
SKIPPED [1] ../../BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pathlib.py:434: symlinks not supported: [Errno 17] File exists: '/tmp/pytest-of-tkloczko/pytest-68/test_collect_symlink_dir0/symlink_dir' -> '/tmp/pytest-of-tkloczko/pytest-68/test_collect_symlink_dir0/dir'
SKIPPED [1] testing/test_config.py:1857: does not work with xdist currently
SKIPPED [1] testing/test_conftest.py:361: only relevant for case insensitive file systems
SKIPPED [1] testing/test_parseopt.py:330: argcomplete not available
SKIPPED [3] testing/test_warnings.py:521: not relevant until pytest 8.0
SKIPPED [9] testing/code/test_excinfo.py:1545: Native ExceptionGroup not implemented
SKIPPED [41] ../../BUILDROOT/python-pytest-7.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/_pytest/pytester.py:1534: 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 - AssertionError: Regex pattern did not match.
==================================================== 1 failed, 3270 passed, 97 skipped, 12 xfailed in 194.97s (0:03:14) ====================================================

@kloczek
Copy link
Contributor Author

kloczek commented Oct 27, 2022

OK sorry I just fount that this unit alredy has been reported by me #9764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants