test discovery
How a test runner finds tests without being told: pytest collects files named test_*.py and, inside them, functions named test_*.
In more detail
A test that does not follow the naming rule is silently skipped, so a misnamed test can never fail. pytest -v lists every test it collected.
Related terms
- pytest — A popular Python testing framework that finds test functions automatically and reports failures with detailed comparisons.
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
Taught in
- Mad Libs Revisited: Finding The Cues — Hands-on Python: Complete Video Course & Book
- Testing With pytest — Hands-on Python: Complete Video Course & Book