Repository navigation
Say where another package registers the test fixtures - #40
Merged
Merged
Conversation
pytest accepts `pytest_plugins` only in a conftest that it loads at startup. The tests directory's `conftest.py` works for `pytest`, a path inside the tests directory, and `--pyargs`, and travels with a tests package in a wheel; `pytest .` at the repository root then fails. A root `conftest.py` works for every run in the repository, but an installed tests package lacks it. The documentation also names `cellsKnown`, and warns that a local fixture with the same name hides the plugin's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMd3z8F4sr4MHYFD1qkphR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documentation for using the test fixtures from another package said to register the plugin in the "root
conftest.py". That is one of two places that work, and the difference matters.pytest accepts
pytest_pluginsonly in a conftest that it loads at startup:conftest.pyof the tests directory thattestpathsnames,pytest,pytest <package>, a path inside the tests directory, andpytest --pyargs <package>.testswork.pytest .at the repository root fails with "Defining 'pytest_plugins' in a non-top-level conftest". This placement travels with a tests package in the wheel.conftest.pyworks for every run inside the repository, but an installed tests package does not have it.The README,
mapFolding/tests/__init__.py, andmapFolding/tests/conftest.pynow say this. They also name thecellsKnownfixture, and say that a local fixture with the same name hides the plugin's. A parameter namedtrianglethat a test does not parametrize receives the A400429 triangle.Only documentation changed. I checked both placements in a separate package with mapFolding 0.42.0 from PyPI.
Generated by Claude Code