Examples and customization tricks ​
Here is a (growing) list of examples. Contact us if you need more examples or have questions. Also take a look at the comprehensive documentation which contains many example snippets as well. Also, pytest on stackoverflow.com often comes with example answers.
For basic examples, see
Get Started for basic introductory examples
How to write and report assertions in tests for basic assertion examples
Fixtures for basic fixture/setup examples
How to parametrize fixtures and test functions for basic test function parametrization
How to use unittest-based tests with pytest for basic unittest integration
How to run tests written for nose for basic nosetests integration
The following examples aim at various use cases you might encounter.