DEV Community

John Mitchell
John Mitchell

Posted on

1

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)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay