tests: pytest-runnable + finish Smoke→Test scrub - #114
Merged
Conversation
- Append a one-line `def test_main(): main()` pytest entry point to each tests/test_*.py file that didn't already expose a discoverable test_* function. `python -m tests.test_<name>` keeps working unchanged. - Rename custom-arg helper functions in test_roles_md.py, test_py_dev_toolkit.py, and test_roles.py from `test_*` to `_check_*` so pytest doesn't try to inject fixtures for their positional params. `main()` still calls them, so the standalone path still exercises them; pytest collects each file's `test_main`. - CI: replace the per-file bash loop with `pytest tests/`. - README: drop the "no pytest" framing and show `pytest tests/` as the primary invocation. - Scrub the remaining capital-S `Smoke` mentions the earlier sed pass missed (README, CI step name, ~35 test docstrings). Verified: black + ruff clean; pytest collects 135 tests, all pass.
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.
Summary
Follow-up to #113. Two things:
Pytest runnable. Appends
def test_main(): main()to eachtests/test_*.pyfile that didn't already expose a discoverabletest_*function, sopytest tests/collects and runs every file. Standalone invocation (python -m tests.test_<name>) still works — the__main__block is untouched.For three files (
test_roles_md.py,test_py_dev_toolkit.py,test_roles.py) that had localtest_*helpers with custom positional params (tmp: Path,tools: dict, etc.), renamed those helpers to_check_*so pytest doesn't try to fixture-resolvetmp/tools. The file-leveltest_mainstill drives them viamain().CI now runs
pytest tests/in one step instead of the bash loop.Capital-S scrub. The earlier
smoke_→test_sed pass was case-sensitive and missedSmokeat the start of docstrings — README, CI step name, and ~35 test file docstrings.Test plan
black --check,ruff check,pytest tests/).pytest tests/→ expect 135 passed.python -m tests.test_token_meterstill works standalone.smoke(case-insensitive) anywhere in the tree.