question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pytest`-related test failures on `main`

See original GitHub issue

We’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:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jrbourbeaucommented, Oct 25, 2022
0reactions
The-Compilercommented, Oct 26, 2022

With my pytest maintainer hat on: Please don’t add py as hard dependency to pytest 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 use py 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 installing py in all pytest installs.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found