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 terminalprogress flag. Furthermore, escape codes are no longer emitted when the TERM environment variable is set to dumb, preventing display issues in minimal environments.
  • config.inicfg Restoration: The private config.inicfg attribute, 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 that config.inicfg will 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 unittest subtests in Python 3.10, has been resolved. This fix improves execution speed for test suites utilizing unittest’s subtest feature.
  • Configuration Type: The TOML type for the tmp_path_retention_count setting in the API reference has been corrected from a number to a string, ensuring accurate documentation for configuration files.

Improved Documentation:

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.