February 2022
Intermediate to advanced
274 pages
6h 28m
English
With pytest installed, we can run test_passing(). This is what it looks like when it’s run:
| | $ cd /path/to/code/ch1 |
| | $ pytest test_one.py |
| | ========================= test session starts ========================== |
| | collected 1 item |
| | |
| | test_one.py . [100%] |
| | |
| | ========================== 1 passed in 0.01s =========================== |
The dot after test_one.py means that one test was run and it passed. The [100%] is a percentage indicator showing how much of the test suite is done so far. Because there is just one test in the test session, one test equals 100% of the tests. If you need more information, you can use -v or --verbose:
| | $ pytest -v test_one.py |
| | ===================== test session starts ====================== ... |