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

Taught in

References