Move the test suite into tests/ - #41
Merged
Merged
Conversation
Rename test.py to tests/test_extinction.py and move testdata alongside it. The rename matters: pytest's default python_files pattern is test_*.py, which plain test.py does not match, so pointing pytest at a directory would have collected nothing. Test data needs no path change, since it is already resolved relative to the test file rather than the working directory, and it moved with it. Update the three places that referenced the old paths: the tox command, the cibuildwheel test-command, and MANIFEST.in. Also exclude __pycache__ from the sdist, which recursive-include would otherwise sweep in. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With testpaths set, a bare pytest from the repo root collects the suite instead of walking the whole tree. The src layout means it still imports the installed extinction rather than the source directory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Moves the test suite into pytest’s conventional tests/ layout while preserving installed-wheel testing and sdist test assets.
Changes:
- Renames the test module and relocates its fixture data.
- Updates tox, pytest, and cibuildwheel test paths.
- Updates sdist inclusion rules and excludes bytecode.
Reviewed changes
Copilot reviewed 3 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tox.ini |
Runs tests from tests/. |
pyproject.toml |
Configures pytest discovery and cibuildwheel. |
MANIFEST.in |
Includes tests and excludes bytecode. |
tests/test_extinction.py |
Relocated test suite. |
tests/testdata/README.md |
Relocated fixture documentation. |
tests/testdata/run.pro |
Relocated fixture generator. |
tests/testdata/fm_unred_2.3.dat |
Relocated reference data. |
tests/testdata/fm_unred_3.1.dat |
Relocated reference data. |
tests/testdata/fm_unred_4.0.dat |
Relocated reference data. |
tests/testdata/fm_unred_5.3.dat |
Relocated reference data. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Moves
test.pytotests/test_extinction.py, withtestdata/alongside it astests/testdata/. Git records all of these as renames, so the diff is a move rather than a delete-and-add.The rename is load-bearing
pytest's default
python_filespattern istest_*.py, which a plaintest.pydoes not match — it only ever ran because tox and cibuildwheel passed the filename explicitly. Keeping the name and pointing pytest at the directory would have silently collected zero tests and passed. Verified after the rename: 9 collected, 9 passed.Test data needed no path change
TESTDATA_DIRalready resolves relative to the test file rather than the working directory, so moving the data alongside the test file just works. That was the fix made in #38 to let the suite run against an installed wheel; it pays off again here.References updated
tox.ini:pytest test.py→pytest tests[tool.cibuildwheel] test-command:pytest {project}/test.py→pytest {project}/testsMANIFEST.in: the two old entries →recursive-include tests *[tool.pytest.ini_options] testpaths = ["tests"], so a barepytestfrom the repo root collects the suite instead of walking the whole treeOne thing caught while verifying
recursive-include tests *swept a straytests/__pycache__/test_extinction.cpython-314-pytest-9.1.1.pycinto the sdist. Addedglobal-exclude __pycache__/* *.py[cod], and confirmed the rebuilt sdist contains only the test module and the six data files.Verification
tests/test_extinction.pyandtests/testdata/*and no bytecode; the wheel contains no test files at all.pytest {project}/tests— the exact form cibuildwheel will run — passes 9/9 from an unrelated working directory against the installed wheel.pytestfrom the repo root also passes 9/9, importing the installed extension rather than the source tree, since the src layout keepssrc/offsys.path.🤖 Generated with Claude Code