Change8

8.4.2

📦 pytestView on GitHub →
🐛 5 fixes🔧 2 symbols

Summary

pytest 8.4.2 fixes several crashes (including console output style, decimal handling, and NumPy imports) and improves Python 3.14 compatibility.

🐛 Bug Fixes

  • Fixed a crash when using `console_output_style` with `times` and a module is skipped (issue #13478).
  • Fixed a crash when using `pytest.approx` with `decimal.Decimal` instances and the `decimal.FloatOperation` trap set (issue #13530).
  • Stopped evaluating type annotations in Python 3.14 when inspecting function signatures, preventing crashes for modules that import types only inside `if TYPE_CHECKING:` blocks (issue #13549).
  • Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in `pytest.Parser.addini` (issue #13559).
  • Changed `pytest.approx` to import NumPy only if it is already present in `sys.modules`, fixing the unconditional import introduced in 8.4.0 (issue #13563).

🔧 Affected Symbols

pytest.approxpytest.Parser.addini