Skip to content

Say where another package registers the test fixtures - #40

Merged
hunterhogan merged 1 commit into
mainfrom
claude/affectionate-fermat-hq7oao
Nov 30, 2026
Merged

hunterhogan merged 1 commit into
mainfrom
claude/affectionate-fermat-hq7oao

Conversation

@hunterhogan

Copy link
Copy Markdown
Owner

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_plugins only in a conftest that it loads at startup:

  • In the conftest.py of the tests directory that testpaths names, pytest, pytest <package>, a path inside the tests directory, and pytest --pyargs <package>.tests work. 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.
  • A root conftest.py works for every run inside the repository, but an installed tests package does not have it.

The README, mapFolding/tests/__init__.py, and mapFolding/tests/conftest.py now say this. They also name the cellsKnown fixture, and say that a local fixture with the same name hides the plugin's. A parameter named triangle that 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

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
@hunterhogan
hunterhogan marked this pull request as ready for review November 30, 2026 16:12
@hunterhogan
hunterhogan merged commit 6a558cc into main Nov 30, 2026
10 checks passed
@hunterhogan
hunterhogan deleted the claude/affectionate-fermat-hq7oao branch November 30, 2026 16:16
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.

2 participants