pytest 9.0.2, released on 2025-12-06, is a significant maintenance update focusing on stability and compatibility for the popular Python testing framework. This release addresses several key issues, ensuring a smoother experience for QA engineers.
Key Changes
pytest 9.0.2 delivers crucial bug fixes and documentation enhancements, addressing several compatibility and performance issues.
Bug Fixes:
- Terminal Progress: The new terminal progress feature, introduced in pytest 9.0.0, is now disabled by default across most platforms (except Windows). This change was implemented to resolve compatibility issues with various terminal emulators. Users can explicitly re-enable this feature by passing the
-p terminalprogressflag. Furthermore, escape codes are no longer emitted when theTERMenvironment variable is set todumb, preventing display issues in minimal environments. config.inicfgRestoration: The privateconfig.inicfgattribute, which experienced a breaking change in pytest 9.0.0, has been restored to working order using a compatibility shim. This ensures continued functionality for existing plugins and configurations that rely on this attribute. It is important to note thatconfig.inicfgwill be formally deprecated in pytest 9.1 and is scheduled for removal in pytest 10.- Performance: A significant quadratic-time performance issue, specifically when handling
unittestsubtests in Python 3.10, has been resolved. This fix improves execution speed for test suites utilizingunittest’s subtest feature. - Configuration Type: The TOML type for the
tmp_path_retention_countsetting in the API reference has been corrected from a number to a string, ensuring accurate documentation for configuration files.
Improved Documentation:
- The official API Reference now includes detailed, cross-referenceable documentation for pytest’s command-line flags. This enhancement provides a centralized and easily navigable resource for understanding all available command-line options, beneficial for both new users learning pytest testing fundamentals and experienced engineers exploring advanced pytest techniques.
For full details, refer to the official pytest 9.0.2 changelog.
Impact for QA Teams
This update stabilizes pytest’s terminal output, ensuring smoother execution across diverse environments. The config.inicfg restoration prevents potential breakage for existing plugins, while performance improvements benefit projects using unittest subtests. Enhanced documentation makes navigating command-line options easier for all users, streamlining test automation workflows.
