pytest-dev / pytest-dev/pytest
Provide for including fixtures from common location [improvement]
Open
Nobody has claimed this yet.
topic: fixtures
type: enhancement
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
It'd be very convenient to have a method similar to pytest_plugins = ['path.to.plugin'], but purely for fixture inclusion.
Reasoning:
- You can move common fixtures to a parent conftest.py, but that can lead to exceptionally large conftest.py files in larger projects
- Would let you keep similar fixtures grouped together for common imports/functionality
- You can import fixtures from other locations, but if you don't directly reference them, they are seen as 'unused' by most linters.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading pytest_plugins handling and conftest.py fixture discovery, then compare how fixtures are currently imported from other locations. Define how a fixture-inclusion mechanism would group and expose fixtures without direct references, and verify the behavior with focused pytest tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100