`pytest`-related test failures on `main`
See original GitHub issueWe’re seeing failures like
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/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/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/xdist/plugin.py", line 192, in pytest_configure
INTERNALERROR> from xdist.dsession import DSession
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR> exec(co, module.__dict__)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/xdist/dsession.py", line 5, in <module>
INTERNALERROR> from xdist.scheduler import (
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR> exec(co, module.__dict__)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/xdist/scheduler/__init__.py", line 1, in <module>
INTERNALERROR> from xdist.scheduler.each import EachScheduling # noqa
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
INTERNALERROR> exec(co, module.__dict__)
INTERNALERROR> File "/usr/share/miniconda3/envs/test-environment/lib/python3.10/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
on main
. For an example of this in action see this CI build
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
`pytest-benchmark`: AttributeError: module 'py' has no ...
When I run test cases with 7.2.0 I get this error: py39-opentelemetry-sdk ... pytest -related test failures on main dask/dask#9597.
Read more >How to handle test failures
To stop the testing process after the first (N) failures: ... This will invoke the Python debugger on every failure (or KeyboardInterrupt).
Read more >Project:Python/Tests - Gentoo Wiki
Deal with failing tests. If some tests fail, always investigate the issue. You should work with upstream on ensuring that all tests pass ......
Read more >Known Issues — Astropy v3.2.dev994
Build/installation/test issues. Anaconda users should upgrade with conda , not pip; Locale errors in MacOS X and Linux; Creating a Time object fails...
Read more >Pytest Features, That You Need in Your (Testing) Life
There are many more cool features in Pytest related to skipping or anticipating failures and they are very well documented here, so I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as fixed (xref https://github.com/dask/dask/pull/9596#issuecomment-1291094796)
With my pytest maintainer hat on: Please don’t add
py
as hard dependency topytest
itself - the whole point of the change in pytest is to get rid of the dependency where it’s not actually needed. That various plugins usepy
without directly declaring it as a dependency is unfortunate, but that should be fixed in those plugins (or in their package, if necessary as a workaround), and not by installingpy
in all pytest installs.