Overview - Test discovery rules
What is it?
Test discovery rules are the guidelines pytest uses to find and run test files and test functions automatically. Pytest looks for files and functions that match specific naming patterns so it knows what to test without manual input. This helps testers run all tests quickly and consistently. Without these rules, you would have to specify every test manually, which is slow and error-prone.
Why it matters
Test discovery rules save time and reduce mistakes by automatically finding tests to run. Without them, testers might miss running some tests or run wrong files, leading to bugs slipping into software. This automation makes testing faster and more reliable, which improves software quality and developer confidence.
Where it fits
Before learning test discovery rules, you should understand basic pytest test writing and running tests manually. After mastering discovery, you can learn about customizing discovery, test selection, and advanced pytest features like fixtures and plugins.