Daniel Roy Greenfeld

Daniel Roy Greenfeld

About | Articles | Open Source | Books | Tags | Search

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().

Today I Learned

Tags: python tech testing TIL

← Back to all articles

Search