Skip to content

tests: pytest-runnable + finish Smoke→Test scrub - #114

Merged
derekwisong merged 1 commit into
mainfrom
cleanup/pytest-and-smoke-followup
May 14, 2026
Merged

tests: pytest-runnable + finish Smoke→Test scrub#114
derekwisong merged 1 commit into
mainfrom
cleanup/pytest-and-smoke-followup

Conversation

@derekwisong

@derekwisong derekwisong commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #113. Two things:

Pytest runnable. Appends def test_main(): main() to each tests/test_*.py file that didn't already expose a discoverable test_* function, so pytest 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 local test_* helpers with custom positional params (tmp: Path, tools: dict, etc.), renamed those helpers to _check_* so pytest doesn't try to fixture-resolve tmp / tools. The file-level test_main still drives them via main().

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 missed Smoke at the start of docstrings — README, CI step name, and ~35 test file docstrings.

Test plan

  • CI passes (black --check, ruff check, pytest tests/).
  • Locally: pytest tests/ → expect 135 passed.
  • Locally: python -m tests.test_token_meter still works standalone.
  • Search confirms zero smoke (case-insensitive) anywhere in the tree.

- 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.
@derekwisong
derekwisong merged commit 3024e59 into main May 14, 2026
1 check passed
@derekwisong
derekwisong deleted the cleanup/pytest-and-smoke-followup branch May 14, 2026 02:45
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.

1 participant