How-to guides
Core pytest functionality
- How to invoke pytest
- How to write and report assertions in tests
- How to use fixtures
- How to mark test functions with attributes
- How to parametrize fixtures and test functions
- How to use subtests
- How to use temporary directories and files in tests
- How to monkeypatch/mock modules and environments
- How to run doctests
- How to re-run failed tests and maintain state between test runs
Test output and outcomes
Plugins
pytest and other test systems
pytest development environment
© 2015–2026 Holger Krekel and pytest-dev team
Licensed under the MIT License.
https://docs.pytest.org/en/stable/how-to/index.html