DEV Community

John Mitchell
John Mitchell

Posted on

Pytest is a Joy Forever

I love this command so much:

pytest --exitfirst --failed-first --showlocals
Enter fullscreen mode Exit fullscreen mode

It:
1) runs all tests,
2) stops on first error, and
3) when rerun, runs those tests first.

It also shows local variables on error, which 90% of the time you can cut-paste into the test assert and then the test will pass ❤️ ❤️

Top comments (0)