Skip to content

Modularise pytest fixtures#373

Open
willGraham01 wants to merge 7 commits intomainfrom
wgraham/353-modularise-fixtures
Open

Modularise pytest fixtures#373
willGraham01 wants to merge 7 commits intomainfrom
wgraham/353-modularise-fixtures

Conversation

@willGraham01
Copy link
Collaborator

@willGraham01 willGraham01 commented Mar 19, 2026

Closes #353 |

Breaks out the fixtures and command-line options in conftest.py into the (new) tests/fixtures directory.

  • conftest.py now discovers all pytest-related options (EG CLI flags) and objects (EG fixtures) defined inside *.py files in tests/fixtures. Sub-directories are also recursed into.
  • The command-line addoptions have been moved to pytest_cli_options.py.
  • The signal generation fixtures also have their own file.
  • The fixtures used to cache and load cached data have their own fixtures/caching subdirectory & are further broken down into files. Some "module-level" constants have been made into fixtures to allow their discoverability elsewhere.

@willGraham01 willGraham01 force-pushed the wgraham/353-modularise-fixtures branch from b08b172 to 3585560 Compare March 19, 2026 08:55
@willGraham01 willGraham01 marked this pull request as ready for review March 19, 2026 08:55
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.90%. Comparing base (1e1fc89) to head (3585560).

❗ There is a different number of reports uploaded between BASE (1e1fc89) and HEAD (3585560). Click for more details.

HEAD has 9 uploads less than BASE
Flag BASE (1e1fc89) HEAD (3585560)
10 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #373       +/-   ##
===========================================
- Coverage   96.09%   79.90%   -16.20%     
===========================================
  Files          32       32               
  Lines        3458     3458               
===========================================
- Hits         3323     2763      -560     
- Misses        135      695      +560     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modularize fixtures in conftest.py

1 participant