🧪Test Runner
Also known as Test Harness, Test Command
The tool that finds your tests, runs them and shows how many passed.
Think of it like
Think of it like a teacher. They hand out the quiz, mark it and read the score.
Example
Lucy types pytest in her project folder. It finds 48 tests in 6 files, runs them and prints 48 passed in 1.2 seconds.
Why it matters
Without a runner you would call every test by hand. The runner makes the whole suite one command.
Definition
Example code
console
$ pytest -q test_cart.py
. [100%]
1 passed in 0.02sCommon mistake
Key takeaways
- 1Finds the tests. By file and function names.
- 2Runs them all. One command.
- 3Reports the score. Passed, failed, and why.