Overview

pytest 9.0, released on November 8, 2025, introduces native subtests, TOML configuration and an enhanced strict mode.

Main Features

Native subtests

pytest now natively supports subtests, allowing multiple assertions in a single test without stopping at the first failure.

python
def test_operations(subtests):
    cases = [(2, 3, 5), (0, 0, 0), (-1, 1, 0)]
    for a, b, expected in cases:
        with subtests.test(a=a, b=b):
            assert a + b == expected

TOML config and strict mode

Configuration can now be written in native TOML (pytest.toml). Strict mode makes unregistered warnings into errors by default.

toml
# pytest.toml
[tool.pytest.ini_options]
strict = true
markers = [
    "slow: slow tests",
]

Sources