Skip to content

Commit 92858ee

Browse files
amurekibluetech
authored andcommitted
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
1 parent 3f550d9 commit 92858ee

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ Example using pytest.ini or tox.ini
3333
Example using pyproject.toml
3434
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3535

36+
For pytest 9.0 and later, use the native TOML format:
37+
38+
.. code-block:: toml
39+
40+
# -- Example FILE: pyproject.toml
41+
[tool.pytest]
42+
DJANGO_SETTINGS_MODULE = "test.settings"
43+
# -- recommended but optional:
44+
python_files = ["test_*.py", "*_test.py", "testing/python/*.py"]
45+
46+
For pytest 7.x and 8.x, use the INI-compatible format:
47+
3648
.. code-block:: toml
3749
3850
# -- Example FILE: pyproject.toml

0 commit comments

Comments
 (0)