pytest tips and tricks for a better testsuite
Freya Bruhin
Date
Thursday, April 16, 2026
Time
1:10 PM - 2:40 PM
Room
Ferrum [2nd Floor]
Tutorial
PyCon: Programming & Software Engineering & Testing
Transcription
We'll cover things like:
- Recommended pytest settings for more strictness
- What's xfail and why is it useful?
- How to mark an entire test file or single parameters
- Ways to deal with parametrize IDs and syntax
- Useful built-in pytest fixtures
- Caching for fixtures
- Using fixtures implicitly
- Advanced fixture and parametrization topics
- How to customize fixtures behavior based on markers or custom CLI arguments
- If time permits: Short intro to writing pytest plugin and to property-based testing with Hypothesis
To prepare, please clone the GitHub repository and follow the setup steps in the README.