diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 4e8d0a22..9e03e868 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -266,7 +266,7 @@ def tearDownClass(cls) -> None: django_db_blocker.restore() -def validate_django_db(marker) -> _DjangoDb: +def validate_django_db(marker: pytest.Mark) -> _DjangoDb: """Validate the django_db marker. It checks the signature and creates the ``transaction``, diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index 8d85e2e0..62fa1791 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -617,7 +617,7 @@ def django_mail_dnsname() -> str: @pytest.fixture(autouse=True) def _django_set_urlconf(request: pytest.FixtureRequest) -> Generator[None, None, None]: """Apply the @pytest.mark.urls marker, internal to pytest-django.""" - marker = request.node.get_closest_marker("urls") + marker: pytest.Mark | None = request.node.get_closest_marker("urls") if marker: skip_if_no_django() import django.conf @@ -836,7 +836,7 @@ def restore(self) -> None: blocking_manager_key = pytest.StashKey[DjangoDbBlocker]() -def validate_urls(marker) -> list[str]: +def validate_urls(marker: pytest.Mark) -> list[str]: """Validate the urls marker. It checks the signature and creates the `urls` attribute on the