Skip to content

feat: re-export SettingsWrapper from pytest_django for typing (#1257)#1280

Open
SAY-5 wants to merge 1 commit into
pytest-dev:mainfrom
SAY-5:export-settings-wrapper
Open

feat: re-export SettingsWrapper from pytest_django for typing (#1257)#1280
SAY-5 wants to merge 1 commit into
pytest-dev:mainfrom
SAY-5:export-settings-wrapper

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 21, 2026

Closes #1257.

SettingsWrapper is now importable from the top-level pytest_django namespace so the settings fixture can be type-annotated without reaching into pytest_django.fixtures:

from pytest_django import SettingsWrapper

def test_with_specific_settings(settings: SettingsWrapper):
    ...

Mirrors the existing pattern used for DjangoAssertNumQueries and DjangoCaptureOnCommitCallbacks.

  • adds SettingsWrapper to pytest_django.__all__
  • documents the typing usage under the settings fixture in docs/helpers.rst
  • changelog entry under v4.12.1
  • regression test in TestSettings

@SAY-5 SAY-5 force-pushed the export-settings-wrapper branch from 52df77a to b0ca5ec Compare May 21, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing support for settings fixture?

1 participant