diff --git a/docs/configuring_django.rst b/docs/configuring_django.rst index da503b72..75f247e2 100644 --- a/docs/configuring_django.rst +++ b/docs/configuring_django.rst @@ -43,7 +43,7 @@ Example contents of pytest.ini:: Example contents of pyproject.toml:: - [tool.pytest.ini_options] + [tool.pytest] DJANGO_SETTINGS_MODULE = "test.settings" Order of choosing settings @@ -83,7 +83,7 @@ INI File Contents:: pyproject.toml File Contents:: - [tool.pytest.ini_options] + [tool.pytest] DJANGO_CONFIGURATION = "MySettings" Using ``django.conf.settings.configure()`` diff --git a/docs/index.rst b/docs/index.rst index 58040075..98df7f01 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,11 +24,8 @@ Example using pytest.ini or tox.ini .. code-block:: ini - # -- FILE: pytest.ini (or tox.ini) [pytest] DJANGO_SETTINGS_MODULE = test.settings - # -- recommended but optional: - python_files = tests.py test_*.py *_tests.py Example using pyproject.toml ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -37,21 +34,15 @@ 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 [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "test.settings" - # -- recommended but optional: - python_files = ["test_*.py", "*_test.py", "testing/python/*.py"] Run your tests with ``pytest``: