TIL: pytest with breakpoints
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()
.

Tags: python testing TIL