Courtesy of Holger Krekel’s lecture

Recently, I had the privilege to attend a multi-day lecture with the author of pytest. While I’ve read the docs several times over now, I still picked up on a few new features and tricks. Here are some cool tips whose existence I’d like to stress.

Pytest Tricks & Tips

Useful Pytest Options:

Useful Pytest Pytest.ini options

Useful Pytest Plugins

Generally Useful Python Utilities

Pytest DSLs (TODO: Finish this section)

Pytest is all about reducing boilerplate. If your testing consists primarily of parameters, a good option might be to implement your own pytest DSL. A major advantage of this is that non-python programmers can still use this DSL to expand on a suite of data driven tests.

The four main parts of a pytest DSL.

Two Major Imports for Python 23 compliance