Skip to content

Upgrade to pytest 9.2.0 and a supported pytest-asyncio version #2114

Open

Description

@VegetarianOrc

Background

The development dependencies currently constrain pytest-asyncio to >=0.21,<0.22. pytest-asyncio 0.21.2 accesses the private pytest attribute FixtureManager._arg2fixturedefs, which was removed in pytest 9.2.0. With that combination, test collection fails with:

AttributeError: FixtureManager object has no attribute _arg2fixturedefs

The latest-dependencies CI job began selecting pytest 9.2.0 when it crossed the repository two-week release cutoff. PR #2113 caps pytest below 9.2 as a temporary workaround.

Proposed work

  • Upgrade pytest-asyncio to a supported release compatible with pytest 9.2.0 and the Python versions supported by this repository.
  • Migrate the session-scoped event_loop override in tests/conftest.py to the supported loop-scope configuration. pytest-asyncio 1.0 removed the old event_loop fixture mechanism.
  • Preserve the loop sharing required by session-scoped async fixtures and verify fixture setup, teardown, and test isolation.
  • Remove the temporary pytest<9.2 cap and refresh uv.lock without unrelated dependency churn.
  • Account for the two-week dependency cutoff when choosing the plugin release.

Validation

  • Test collection succeeds with pytest 9.2.0 and the chosen plugin version.
  • The full test suite and latest-dependencies CI job pass, including workflow-environment tests and the supported Python/platform matrix.
  • Async resources are cleaned up without new loop-scope, closed-loop, or resource-leak failures.

References

pytest-asyncio 1.4.1.post1 is a candidate: its metadata allows pytest>=8.4 without an upper bound. Compatibility with this repository still needs to be validated.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions