cookbook

PyTest

PyTest is an alternate test runner and framework to the built-in unittest module. What does it provide that you might want when Python already includes a test framework in the standard library?

Tips

Re-run Recent Failed Tests First

py.test --ff # or --first-failed

…or re-run only the failing tests

py.test --lf  # or --last-failed

Stop on First Test Failure

py.test -x