Plugins That Alter or Enhance Output

These plugins don’t change how test are run, but they do change the output you see.

pytest-instafail: See Details of Failures and Errors as They Happen

Usually pytest displays the status of each test, and then after all the tests are finished, pytest displays the tracebacks of the failed or errored tests. If your test suite is relatively fast, that might be just fine. But if your test suite takes quite a bit of time, you may want to see the tracebacks as they happen, rather than wait until the end. This is the functionality of the pytest-instafail plugin.[38] When tests are run with the --instafail flag, the failures and errors appear right away.

Here’s a test with normal failures at the end:

 $ ​​cd​​

Get Python Testing with pytest now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.