TIL: pytest with breakpoints
Injecting breakpoints into a failing pytest run
To inject a breakpoint into a failing pytest run, add --pdb to your pytest command:
py.test --pdb
This will drop you into a pdb session at the point of failure. You can then inspect the state of the program just like you would if you injected a breakpoint().

