Skip to content

pytest-related test failures on main #9597

Closed

Description

@jrbourbeau

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

Activity

  1. added
    tests
    on Oct 25, 2022
  2. jakirkham commented on Oct 25, 2022

    @jakirkham
    Member

    Copying my comment ( #9596 (comment) ) here:

    Maybe this is related to the recent pytest upgrade ( conda-forge/pytest-feedstock#153 )? Perhaps we can raise a reproducer on that feedstock

  3. jrbourbeau commented on Oct 25, 2022

    @jrbourbeau
    MemberAuthor

    Here's the upstream issue in pytest pytest-dev/pytest#10422 / pytest-dev/pytest#10420. Looks like this is related to pytest-benchmark not declaring a dependency (xref ionelmc/pytest-benchmark#227) -- though I don't think we have pytest-benchmark installed in our CI environments. Folks upstream in pytest are pointing to this pytest-benchmark fix ionelmc/pytest-benchmark#227. I'll try pinning pytest in CI to see if that works as a temporary fix.

  4. jrbourbeau commented on Oct 25, 2022

    @jrbourbeau
    MemberAuthor

    Ah, it looks like various pytest-* packages are impacted by an upstream pytest change (xref pytest-dev/pytest#10396). In our case, I think it's pytest-xdist (xref pytest-dev/pytest-xdist#832)

  5. jakirkham commented on Oct 25, 2022

    @jakirkham
    Member

    We can just install py on our CI while they work through these issues (which probably will take some time)

  6. jrbourbeau commented on Oct 25, 2022

    @jrbourbeau
    MemberAuthor

    Yeah, I was just coming around to that. Do you think it's worth add py upstream in the pytest conda-forge recipe?

  7. jakirkham commented on Oct 25, 2022

    @jakirkham
    Member

    We could raise that in a feedstock issue and see what the maintainers say

  8. jrbourbeau commented on Oct 25, 2022

    @jrbourbeau
    MemberAuthor

    Closing as fixed (xref #9596 (comment))

  9. The-Compiler commented on Oct 26, 2022

    @The-Compiler

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions