September 2017
Intermediate to advanced
222 pages
5h 1m
English
The pdb module is the Python debugger in the standard library. You use --pdb to have pytest start a debugging session at the point of failure. Let’s look at pdb in action in the context of the Tasks project.
In Parametrizing Fixtures, we left the Tasks project with a few failures:
| | $ cd /path/to/code/ch3/c/tasks_proj |
| | $ pytest --tb=no -q |
| | .........................................FF.FFFF |
| | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFF........... |
| | 42 failed, 54 passed in 4.74 seconds |
Before we look at how pdb can help us debug this test, let’s take a look at the pytest options available to help speed up debugging test failures, which we first looked at in Using Options:
Read now
Unlock full access