From 0005e974b5f105953fb272dc877db989e4d12b88 Mon Sep 17 00:00:00 2001 From: Rust Saiargaliev Date: Mon, 1 Dec 2025 09:38:20 +0100 Subject: [PATCH] docs: add pytest 9.0+ native TOML configuration format Update pyproject.toml examples to show the new `[tool.pytest]` native TOML format introduced in pytest 9.0, while keeping `[tool.pytest.ini_options]` for pytest 7.x/8.x compatibility. Reference: https://docs.pytest.org/en/stable/changelog.html#pytest-9-0-0-2025-11-05 --- docs/index.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index b34c07e8..58040075 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,6 +33,18 @@ Example using pytest.ini or tox.ini Example using pyproject.toml ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +For pytest 9.0 and later, use the native TOML format: + +.. code-block:: toml + + # -- Example FILE: pyproject.toml + [tool.pytest] + DJANGO_SETTINGS_MODULE = "test.settings" + # -- recommended but optional: + python_files = ["test_*.py", "*_test.py", "testing/python/*.py"] + +For pytest 7.x and 8.x, use the INI-compatible format: + .. code-block:: toml # -- Example FILE: pyproject.toml