py.test is a great framework. the documentation is pretty okay once you know what you're looking for, but when you're just getting started out or unlock its more powerful features, it can be rough going.
these examples are meant to
- help me remember and always have some boilerplate around for different types of tests
- help you learn, refresh, or copy-paste basic pytest code for your own use.
so feel free to yoink anything you like from here. if you find some of these test examples atrocious, and have some good arguments around best practices, start a discussion! if you want to contribute a better example or some additional examples around pytest plugins, make a pull request!
we're all better off when more of us know how to write tests.
py.test is quite straightforward to use, actively developed, and has an extensive library of plugins. it can even make writing tests fun!
right:
$ pip install pytest
or, since you're using this tutorial:
$ pip install -r requirements.txt