Skip to content

Python: Modernize pytest fixtures and test package layout #9631

Open

Description

Maintainer-owned issue. Community contributors: please do not pick up or start implementing this issue.

Category

Repository maintenance

Problem

Tests directly import helpers from conftest.py, mix reusable parameterized factories with ordinary functions, and retain test-package init.py files that conflict with the documented collection layout.

Evidence

The audit found 51 direct conftest imports across roughly 31 files and at least five init.py files under test directories. Reusable make_, create_, and build_* patterns are spread across many package tests.

Desired Outcome

Consume fixtures through pytest injection, use fixtures returning callable factories for reusable parameterized setup, move non-fixture helpers to normal helper modules, remove test-package init.py files, and preserve the required package-specific test directory layout.

Language

Python

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

Ownership: Core maintainers only; not available for community pickup.

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

    pythonUsage: [Issues, PRs], Target: Python

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions