Example using pyproject.toml
For pytest 9.0 and later, use the native TOML format:
[tool.pytest]
DJANGO_SETTINGS_MODULE = "test.settings"
For pytest 7.x and 8.x, use the INI-compatible format:
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "test.settings"
Run your tests with pytest: