test: add a packaging test so make test cannot pass on an empty suite - #94
Open
tschm wants to merge 1 commit into
Open
test: add a packaging test so make test cannot pass on an empty suite#94tschm wants to merge 1 commit into
tschm wants to merge 1 commit into
Conversation
`make test` searches TESTS_FOLDER for test_*.py / *_test.py and, finding none, prints a warning and exits 0 — so a project with no tests passes `make test` and therefore `make all` while measuring nothing. This adds the one test that closes that hole: it asserts the version declared in pyproject.toml is the version actually installed, which is the invariant that breaks most often on a fresh checkout (a stale editable install, a `uv sync` that never ran, a package directory the build backend does not pick up). Each of those otherwise surfaces as a confusing ImportError several files later. It is deliberately self-contained — no fixtures, no conftest — so it does not depend on anything under .rhiza/tests. pytest.ini alongside it: - log_cli goes from true to false. Live DEBUG logging on every run buries the result; opt back in per-run with `pytest -o log_cli=true --log-cli-level=DEBUG`. - pythonpath = .rhiza/tests, resolved relative to rootdir and harmless when that directory is absent, so the synced suite is importable without each conftest editing sys.path at import time. - the class-scoped-instance-method fixture deprecation becomes an error, so it cannot regress silently. Matched by message rather than category, because the category name is version-specific (PytestRemovedIn9Warning vs ...In10) and naming a missing class breaks `--resolution lowest-direct` at parse time. Third-party DeprecationWarnings stay non-fatal. Both files come from rhiza v1.3.3; they are the part of that sync that needs nothing else from it. Verified on this branch: 173 passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tschm
added a commit
to tschm/pycharting
that referenced
this pull request
Aug 18, 2026
The tail of the v0.18.8 -> v1.3.3 sync: the rhiza_*.yml callers repinned from @v0.19.9 to @v1.3.3, three new workflows (fuzzing, mutation, scorecard), the pre-commit and bandit configs, the ruff rule set, TESTS.md and the lock. Everything separable has been separated and sent upstream: repo metadata (alihaskar#91), the .rhiza/tests layout (alihaskar#92), the make layer and the .rhiza/requirements removal (alihaskar#93), the packaging test and pytest.ini (alihaskar#94), and the inert config and data files (alihaskar#95). What is left needs the v1.3.3 make layer underneath it, or in ruff.toml's case needs source changes first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a minimal “packaging invariant” test and updates pytest configuration so make test cannot succeed with an empty test suite, improving baseline CI signal for fresh checkouts.
Changes:
- Add
tests/test_rhiza_packaging.pyto assert the installed distribution version matchespyproject.toml. - Update
pytest.inito adjust logging defaults, add.rhiza/teststopythonpath, and make a specific pytest deprecation warning fatal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_rhiza_packaging.py |
Introduces a baseline packaging/version invariant test to ensure the suite is non-empty and validates installs. |
pytest.ini |
Tweaks pytest defaults (logging, import path, warning filtering) to support the synced template test layout and stricter deprecation handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+87
to
+90
| try: | ||
| found = installed_version(name) | ||
| except PackageNotFoundError: | ||
| pytest.skip(f"{name!r} is not installed as a distribution (a virtual project has no metadata)") |
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.
Adds the one test a project needs to have before
make testmeans anything, plus thepytest.inithat goes with it. Both come from rhizav1.3.3; they are the part of that sync that depends on nothing else in it, so they land onmasterdirectly.The hole this closes
make testsearchesTESTS_FOLDERfortest_*.py/*_test.pyand, finding none, prints a warning and exits 0. A project with no tests therefore passesmake test, and so passesmake all, while measuring nothing.tests/test_rhiza_packaging.pyfills that vacuum with a real invariant: the version declared inpyproject.tomlis the version actually installed in the environment. That is the thing that breaks most often on a fresh checkout — a stale editable install after a rename, auv syncthat never ran, a package directory the build backend is not configured to pick up. Each of those otherwise surfaces as a confusingImportErrorseveral files later.It is deliberately self-contained: no fixtures, no
conftest, no dependency on anything under.rhiza/tests.pytest.ini
log_clitrue → false. Live DEBUG logging on every run buries the result. Opt back in per-run:pytest -o log_cli=true --log-cli-level=DEBUG.pythonpath = .rhiza/tests— resolved relative to rootdir, harmless when that directory is absent, so the synced suite is importable without eachconftesteditingsys.pathat import time.PytestRemovedIn9Warningvs...In10Warning) and naming a missing class breaks--resolution lowest-directruns at parse time. Third-partyDeprecationWarnings stay non-fatal.Verification
Run on this branch against the current source: 173 passed.
Independent of my other open PRs (#91, #92, #93) — merge in any order.