pytest reference documentationΒΆ
- Pytest API and builtin fixtures
- Basic test configuration
- The writing and reporting of assertions in tests
- pytest fixtures: explicit, modular, scalable
- Fixtures as Function arguments
- “Funcargs” a prime example of dependency injection
- Sharing a fixture across tests in a module (or class/session)
- fixture finalization / executing teardown code
- Fixtures can introspect the requesting test context
- Parametrizing a fixture
- Modularity: using fixtures from a fixture function
- Automatic grouping of tests by fixture instances
- using fixtures from classes, modules or projects
- autouse fixtures (xUnit setup on steroids)
- Shifting (visibility of) fixture functions
- Overriding fixtures on various levels
- Fixture functions using “yield” / context manager integration
- Parametrizing fixtures and test functions
- classic xunit-style setup
- Capturing of the stdout/stderr output
- Monkeypatching/mocking modules and environments
- xdist: pytest distributed testing plugin
- Temporary directories and files
- Marking test functions with attributes
- Skip and xfail: dealing with tests that can not succeed
- Asserting deprecation and other warnings
- Support for unittest.TestCase / Integration of fixtures
- Running tests written for nose
- Doctest integration for modules and test files