pytest-dev / pytest-dev/pytest

Provide for including fixtures from common location [improvement]

Open
#3,625 7 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.