From 36251ff418355ac514a346f459fa65f14f3126c9 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 04:32:07 -0400 Subject: [PATCH 1/5] ruff: Fixes ruff linter to warn about all issues --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1caaf78d..5ffeeead 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,7 @@ commands = [testenv:linting] dependency_groups = linting commands = - ruff check --diff {posargs:pytest_django pytest_django_test tests} + ruff check {posargs:pytest_django pytest_django_test tests} ruff format --quiet --diff {posargs:pytest_django pytest_django_test tests} mypy {posargs:pytest_django pytest_django_test tests} ec . From b71170127caf82b5981f7684ab96faf3f40abf4a Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 05:09:38 -0400 Subject: [PATCH 2/5] . --- pytest_django/fixtures.py | 18 +++++++++--------- pytest_django/plugin.py | 2 +- pytest_django_test/app/views.py | 2 +- tests/test_database.py | 2 +- tests/test_fixtures.py | 20 ++++++++++++++------ tests/test_initialization.py | 3 --- 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 1dfa4c3f..6f7929be 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -75,15 +75,15 @@ def django_db_modify_db_settings_xdist_suffix(request: pytest.FixtureRequest) -> @pytest.fixture(scope="session") def django_db_modify_db_settings_parallel_suffix( - django_db_modify_db_settings_tox_suffix: None, - django_db_modify_db_settings_xdist_suffix: None, + django_db_modify_db_settings_tox_suffix: None, # noqa: ARG001 + django_db_modify_db_settings_xdist_suffix: None, # noqa: ARG001 ) -> None: skip_if_no_django() @pytest.fixture(scope="session") def django_db_modify_db_settings( - django_db_modify_db_settings_parallel_suffix: None, + django_db_modify_db_settings_parallel_suffix: None, # noqa: ARG001 ) -> None: """Modify db settings just before the databases are configured.""" skip_if_no_django() @@ -162,12 +162,12 @@ def _get_databases_for_setup( @pytest.fixture(scope="session") def django_db_setup( request: pytest.FixtureRequest, - django_test_environment: None, + django_test_environment: None, # noqa: ARG001 django_db_blocker: DjangoDbBlocker, django_db_use_migrations: bool, django_db_keepdb: bool, django_db_createdb: bool, - django_db_modify_db_settings: None, + django_db_modify_db_settings: None, # noqa: ARG001 ) -> Generator[None, None, None]: """Top level fixture to ensure test databases are available""" from django.test.utils import setup_databases, teardown_databases @@ -206,7 +206,7 @@ def django_db_setup( @pytest.fixture def _django_db_helper( request: pytest.FixtureRequest, - django_db_setup: None, + django_db_setup: None, # noqa: ARG001 django_db_blocker: DjangoDbBlocker, ) -> Generator[None, None, None]: if is_django_unittest(request): @@ -458,7 +458,7 @@ def async_client() -> django.test.AsyncClient: @pytest.fixture -def django_user_model(db: None) -> _UserModel: +def django_user_model(db: None) -> _UserModel: # noqa: ARG001 """The class of Django's user model.""" from django.contrib.auth import get_user_model @@ -474,7 +474,7 @@ def django_username_field(django_user_model: _UserModel) -> str: @pytest.fixture def admin_user( - db: None, + db: None, # noqa: ARG001 django_user_model: _User, django_username_field: str, ) -> _User: @@ -505,7 +505,7 @@ def admin_user( @pytest.fixture def admin_client( - db: None, + db: None, # noqa: ARG001 admin_user: _User, ) -> django.test.Client: """A Django test client logged in as an admin user.""" diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index 0c582403..260a00f9 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -609,7 +609,7 @@ def _dj_autoclear_mailbox() -> None: @pytest.fixture def mailoutbox( - django_mail_patch_dns: None, + django_mail_patch_dns: None, # noqa: ARG001 _dj_autoclear_mailbox: None, ) -> list[django.core.mail.EmailMessage] | None: """A clean email outbox to which Django-generated emails are sent.""" diff --git a/pytest_django_test/app/views.py b/pytest_django_test/app/views.py index 053f70a9..6c15babf 100644 --- a/pytest_django_test/app/views.py +++ b/pytest_django_test/app/views.py @@ -10,5 +10,5 @@ def admin_required_view(request: HttpRequest) -> HttpResponse: return HttpResponse(Template("You are an admin").render(Context())) -def item_count(request: HttpRequest) -> HttpResponse: +def item_count(request: HttpRequest) -> HttpResponse: # noqa: ARG001 return HttpResponse(f"Item count: {Item.objects.count()}") diff --git a/tests/test_database.py b/tests/test_database.py index 2fec1352..06dab8c5 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -39,7 +39,7 @@ def test_noaccess_fixture(noaccess: None) -> None: @pytest.fixture -def non_zero_sequences_counter(db: None) -> None: +def non_zero_sequences_counter(db: None) -> None: # noqa: ARG001 """Ensure that the db's internal sequence counter is > 1. This is used to test the `reset_sequences` feature. diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 6cb6c221..9705f7bd 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -59,7 +59,10 @@ def test_admin_client(admin_client: Client) -> None: assert force_str(resp.content) == "You are an admin" -def test_admin_client_no_db_marker(db: None, admin_client: Client) -> None: +def test_admin_client_no_db_marker( + db: None, # noqa: ARG001 + admin_client: Client +) -> None: assert isinstance(admin_client, Client) resp = admin_client.get("/admin-required/") assert force_str(resp.content) == "You are an admin" @@ -144,7 +147,7 @@ def test_django_assert_max_num_queries_db( @pytest.mark.django_db(transaction=True) def test_django_assert_num_queries_transactional_db( request: pytest.FixtureRequest, - transactional_db: None, + transactional_db: None, # noqa: ARG001 django_assert_num_queries: DjangoAssertNumQueries, ) -> None: with nonverbose_config(request.config): @@ -373,7 +376,13 @@ def test_deleted_again(self, settings) -> None: def test_signals(self, settings) -> None: result = [] - def assert_signal(signal, sender, setting, value, enter) -> None: + def assert_signal( + signal, # noqa: ARG001 + sender, # noqa: ARG001 + setting, + value, + enter + ) -> None: result.append((setting, value, enter)) from django.test.signals import setting_changed @@ -510,7 +519,7 @@ def item(self) -> Item: item: Item = Item.objects.create(name="foo") return item - def test_item(self, item: Item, live_server) -> None: + def test_item(self, item: Item, live_server: None) -> None: pass @pytest.fixture @@ -548,7 +557,6 @@ def test_item_transactional_db(self, item_transactional_db: Item, live_server) - def test_serve_static_with_staticfiles_app( self, django_pytester: DjangoPytester, - settings, ) -> None: """ LiveServer always serves statics with ``django.contrib.staticfiles`` @@ -573,7 +581,7 @@ def test_a(self, live_server, settings): result.stdout.fnmatch_lines(["*test_a*PASSED*"]) assert result.ret == 0 - def test_serve_static_dj17_without_staticfiles_app(self, live_server, settings) -> None: + def test_serve_static_dj17_without_staticfiles_app(self, live_server) -> None: """ Because ``django.contrib.staticfiles`` is not installed LiveServer can not serve statics with django >= 1.7 . diff --git a/tests/test_initialization.py b/tests/test_initialization.py index a15b9f9a..3bc70610 100644 --- a/tests/test_initialization.py +++ b/tests/test_initialization.py @@ -1,13 +1,10 @@ from textwrap import dedent -import pytest - from .helpers import DjangoPytester def test_django_setup_order_and_uniqueness( django_pytester: DjangoPytester, - monkeypatch: pytest.MonkeyPatch, ) -> None: """ The django.setup() function shall not be called multiple times by From b99425b0b6cfa0c208751c4075bedd27f5facb19 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 05:35:33 -0400 Subject: [PATCH 3/5] Fixes ARG002 --- pyproject.toml | 2 -- pytest_django/plugin.py | 2 +- pytest_django/runner.py | 8 +++-- pytest_django_test/db_router.py | 6 ++-- tests/test_database.py | 54 ++++++++++++++++++--------------- tests/test_fixtures.py | 51 ++++++++++++++++++++----------- 6 files changed, 73 insertions(+), 50 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61a51a2f..75915cc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -220,8 +220,6 @@ ignore = [ "S101", # Use of `assert` detected # TODO - need to fix these - "ARG001", # Unused function argument - "ARG002", # Unused method argument "C901", # .. is too complex "COM812", # Trailing comma missing "E501", # Line too long diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index 260a00f9..314fb856 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -833,7 +833,7 @@ def _dj_db_wrapper(self) -> django.db.backends.base.base.BaseDatabaseWrapper: def _save_active_wrapper(self) -> None: self._history.append(self._dj_db_wrapper.ensure_connection) - def _blocking_wrapper(*args: Any, **kwargs: Any) -> NoReturn: + def _blocking_wrapper(*args: Any, **kwargs: Any) -> NoReturn: # noqa: ARG002 __tracebackhide__ = True raise RuntimeError( "Database access not allowed, " diff --git a/pytest_django/runner.py b/pytest_django/runner.py index 1b6571cc..c040b749 100644 --- a/pytest_django/runner.py +++ b/pytest_django/runner.py @@ -12,7 +12,7 @@ def __init__( verbosity: int = 1, failfast: bool = False, keepdb: bool = False, - **kwargs: Any, + **kwargs: Any, # noqa: ARG002 ) -> None: self.verbosity = verbosity self.failfast = failfast @@ -24,7 +24,11 @@ def add_arguments(cls, parser: ArgumentParser) -> None: "--keepdb", action="store_true", help="Preserves the test DB between runs." ) - def run_tests(self, test_labels: Iterable[str], **kwargs: Any) -> int: + def run_tests( + self, + test_labels: Iterable[str], + **kwargs: Any, # noqa: ARG002 + ) -> int: """Run pytest and return the exitcode. It translates some of Django's test command option to pytest's. diff --git a/pytest_django_test/db_router.py b/pytest_django_test/db_router.py index e18ae853..8383a7b5 100644 --- a/pytest_django_test/db_router.py +++ b/pytest_django_test/db_router.py @@ -1,14 +1,14 @@ class DbRouter: - def db_for_read(self, model, **hints): + def db_for_read(self, model, **hints): # noqa: ARG002 if model._meta.app_label == "app" and model._meta.model_name == "seconditem": return "second" return None - def db_for_write(self, model, **hints): + def db_for_write(self, model, **hints): # noqa: ARG002 if model._meta.app_label == "app" and model._meta.model_name == "seconditem": return "second" return None - def allow_migrate(self, db, app_label, model_name=None, **hints): + def allow_migrate(self, db, app_label, model_name=None, **hints): # noqa: ARG002 if app_label == "app" and model_name == "seconditem": return db == "second" diff --git a/tests/test_database.py b/tests/test_database.py index 06dab8c5..cb5b54a0 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -73,20 +73,20 @@ def all_dbs(self, request: pytest.FixtureRequest) -> None: else: raise AssertionError() # pragma: no cover - def test_access(self, all_dbs: None) -> None: + def test_access(self, all_dbs: None) -> None: # noqa: ARG002 Item.objects.create(name="spam") - def test_clean_db(self, all_dbs: None) -> None: + def test_clean_db(self, all_dbs: None) -> None: # noqa: ARG002 # Relies on the order: test_access created an object assert Item.objects.count() == 0 - def test_transactions_disabled(self, db: None) -> None: + def test_transactions_disabled(self, db: None) -> None: # noqa: ARG002 if not connection.features.supports_transactions: pytest.skip("transactions required for this test") assert connection.in_atomic_block - def test_transactions_enabled(self, transactional_db: None) -> None: + def test_transactions_enabled(self, transactional_db: None) -> None: # noqa: ARG002 if not connection.features.supports_transactions: pytest.skip("transactions required for this test") @@ -94,7 +94,7 @@ def test_transactions_enabled(self, transactional_db: None) -> None: def test_transactions_enabled_via_reset_seq( self, - django_db_reset_sequences: None, + django_db_reset_sequences: None, # noqa: ARG002 ) -> None: if not connection.features.supports_transactions: pytest.skip("transactions required for this test") @@ -103,9 +103,9 @@ def test_transactions_enabled_via_reset_seq( def test_django_db_reset_sequences_fixture( self, - db: None, + db: None, # noqa: ARG002 django_pytester: DjangoPytester, - non_zero_sequences_counter: None, + non_zero_sequences_counter: None, # noqa: ARG002 ) -> None: if not db_supports_reset_sequences(): pytest.skip( @@ -130,7 +130,11 @@ def test_django_db_reset_sequences_requested( result = django_pytester.runpytest_subprocess("-v", "--reuse-db") result.stdout.fnmatch_lines(["*test_django_db_reset_sequences_requested PASSED*"]) - def test_serialized_rollback(self, db: None, django_pytester: DjangoPytester) -> None: + def test_serialized_rollback( + self, + db: None, # noqa: ARG002 + django_pytester: DjangoPytester, + ) -> None: django_pytester.create_app_file( """ from django.db import migrations @@ -176,11 +180,11 @@ def test_serialized_rollback_3(): assert result.ret == 0 @pytest.fixture - def mydb(self, all_dbs: None) -> None: + def mydb(self, all_dbs: None) -> None: # noqa: ARG002 # This fixture must be able to access the database Item.objects.create(name="spam") - def test_mydb(self, mydb: None) -> None: + def test_mydb(self, mydb: None) -> None: # noqa: ARG002 if not connection.features.supports_transactions: pytest.skip("transactions required for this test") @@ -188,13 +192,13 @@ def test_mydb(self, mydb: None) -> None: item = Item.objects.get(name="spam") assert item - def test_fixture_clean(self, all_dbs: None) -> None: + def test_fixture_clean(self, all_dbs: None) -> None: # noqa: ARG002 # Relies on the order: test_mydb created an object # See https://github.com/pytest-dev/pytest-django/issues/17 assert Item.objects.count() == 0 @pytest.fixture - def fin(self, request: pytest.FixtureRequest, all_dbs: None) -> Generator[None, None, None]: + def fin(self, all_dbs: None) -> Generator[None, None, None]: # noqa: ARG002 # This finalizer must be able to access the database yield Item.objects.create(name="spam") @@ -203,7 +207,7 @@ def test_fin(self, fin: None) -> None: # Check finalizer has db access (teardown will fail if not) pass - def test_durable_transactions(self, all_dbs: None) -> None: + def test_durable_transactions(self, all_dbs: None) -> None: # noqa: ARG002 with transaction.atomic(durable=True): item = Item.objects.create(name="foo") assert Item.objects.get() == item @@ -211,19 +215,19 @@ def test_durable_transactions(self, all_dbs: None) -> None: class TestDatabaseFixturesAllOrder: @pytest.fixture - def fixture_with_db(self, db: None) -> None: + def fixture_with_db(self, db: None) -> None: # noqa: ARG002 Item.objects.create(name="spam") @pytest.fixture - def fixture_with_transdb(self, transactional_db: None) -> None: + def fixture_with_transdb(self, transactional_db: None) -> None: # noqa: ARG002 Item.objects.create(name="spam") @pytest.fixture - def fixture_with_reset_sequences(self, django_db_reset_sequences: None) -> None: + def fixture_with_reset_sequences(self, django_db_reset_sequences: None) -> None: # noqa: ARG002 Item.objects.create(name="spam") @pytest.fixture - def fixture_with_serialized_rollback(self, django_db_serialized_rollback: None) -> None: + def fixture_with_serialized_rollback(self, django_db_serialized_rollback: None) -> None: # noqa: ARG002 Item.objects.create(name="ham") def test_trans(self, fixture_with_transdb: None) -> None: @@ -311,27 +315,27 @@ def test_databases(self, request: pytest.FixtureRequest) -> None: assert marker.kwargs["databases"] == ["default", "replica", "second"] @pytest.mark.django_db(databases=["second"]) - def test_second_database(self, request: pytest.FixtureRequest) -> None: + def test_second_database(self) -> None: SecondItem.objects.create(name="spam") @pytest.mark.django_db(databases=["default"]) - def test_not_allowed_database(self, request: pytest.FixtureRequest) -> None: + def test_not_allowed_database(self) -> None: with pytest.raises(AssertionError, match="not allowed"): SecondItem.objects.count() with pytest.raises(AssertionError, match="not allowed"): SecondItem.objects.create(name="spam") @pytest.mark.django_db(databases=["replica"]) - def test_replica_database(self, request: pytest.FixtureRequest) -> None: + def test_replica_database(self) -> None: Item.objects.using("replica").count() @pytest.mark.django_db(databases=["replica"]) - def test_replica_database_not_allowed(self, request: pytest.FixtureRequest) -> None: + def test_replica_database_not_allowed(self) -> None: with pytest.raises(AssertionError, match="not allowed"): Item.objects.count() @pytest.mark.django_db(transaction=True, databases=["default", "replica"]) - def test_replica_mirrors_default_database(self, request: pytest.FixtureRequest) -> None: + def test_replica_mirrors_default_database(self) -> None: Item.objects.create(name="spam") Item.objects.using("replica").create(name="spam") @@ -339,7 +343,7 @@ def test_replica_mirrors_default_database(self, request: pytest.FixtureRequest) assert Item.objects.using("replica").count() == 2 @pytest.mark.django_db(databases="__all__") - def test_all_databases(self, request: pytest.FixtureRequest) -> None: + def test_all_databases(self) -> None: Item.objects.count() Item.objects.create(name="spam") SecondItem.objects.count() @@ -369,7 +373,7 @@ def test_available_apps_enabled(self, request: pytest.FixtureRequest) -> None: assert marker.kwargs["available_apps"] == ["pytest_django_test.app"] @pytest.mark.django_db - def test_available_apps_default(self, request: pytest.FixtureRequest) -> None: + def test_available_apps_default(self) -> None: from django.apps import apps from django.conf import settings @@ -377,7 +381,7 @@ def test_available_apps_default(self, request: pytest.FixtureRequest) -> None: assert apps.is_installed(app) @pytest.mark.django_db(available_apps=["pytest_django_test.app"]) - def test_available_apps_limited(self, request: pytest.FixtureRequest) -> None: + def test_available_apps_limited(self) -> None: from django.apps import apps from django.conf import settings diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 9705f7bd..749fcba2 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -30,6 +30,7 @@ if TYPE_CHECKING: from pytest_django.django_compat import _User, _UserModel + from pytest_django.live_server_helper import LiveServer @contextmanager @@ -61,7 +62,7 @@ def test_admin_client(admin_client: Client) -> None: def test_admin_client_no_db_marker( db: None, # noqa: ARG001 - admin_client: Client + admin_client: Client, ) -> None: assert isinstance(admin_client, Client) resp = admin_client.get("/admin-required/") @@ -377,12 +378,12 @@ def test_signals(self, settings) -> None: result = [] def assert_signal( - signal, # noqa: ARG001 - sender, # noqa: ARG001 - setting, - value, - enter - ) -> None: + signal, # noqa: ARG001 + sender, # noqa: ARG001 + setting, + value, + enter, + ) -> None: result.append((setting, value, enter)) from django.test.signals import setting_changed @@ -471,10 +472,10 @@ def test_settings_before(self) -> None: ) TestLiveServer._test_settings_before_run = True # type: ignore[attr-defined] - def test_url(self, live_server) -> None: + def test_url(self, live_server: LiveServer) -> None: assert live_server.url == force_str(live_server) - def test_change_settings(self, live_server, settings) -> None: + def test_change_settings(self, live_server: LiveServer) -> None: assert live_server.url == force_str(live_server) @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use") @@ -489,7 +490,7 @@ def test_settings_restored(self) -> None: ) assert settings.ALLOWED_HOSTS == ["testserver"] - def test_transactions(self, live_server) -> None: + def test_transactions(self, live_server: LiveServer) -> None: # noqa: ARG002 if not connection.features.supports_transactions: pytest.skip("transactions required for this test") @@ -502,12 +503,20 @@ def test_db_changes_visibility(self, live_server) -> None: response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1" - def test_fixture_db(self, db: None, live_server) -> None: + def test_fixture_db( + self, + db: None, # noqa: ARG002 + live_server: LiveServer, + ) -> None: Item.objects.create(name="foo") response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1" - def test_fixture_transactional_db(self, transactional_db: None, live_server) -> None: + def test_fixture_transactional_db( + self, + transactional_db: None, # noqa: ARG002 + live_server: LiveServer, + ) -> None: Item.objects.create(name="foo") response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1" @@ -519,24 +528,32 @@ def item(self) -> Item: item: Item = Item.objects.create(name="foo") return item - def test_item(self, item: Item, live_server: None) -> None: + def test_item(self, item: Item, live_server: LiveServer) -> None: pass @pytest.fixture - def item_db(self, db: None) -> Item: + def item_db(self, db: None) -> Item: # noqa: ARG002 item: Item = Item.objects.create(name="foo") return item - def test_item_db(self, item_db: Item, live_server) -> None: + def test_item_db( + self, + item_db: Item, # noqa: ARG002 + live_server, + ) -> None: response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1" @pytest.fixture - def item_transactional_db(self, transactional_db: None) -> Item: + def item_transactional_db(self, transactional_db: None) -> Item: # noqa: ARG002 item: Item = Item.objects.create(name="foo") return item - def test_item_transactional_db(self, item_transactional_db: Item, live_server) -> None: + def test_item_transactional_db( + self, + item_transactional_db: Item, # noqa: ARG002 + live_server: LiveServer, + ) -> None: response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1" From bc161b88aff9cb663bb924b65e669ab019c2ce67 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 05:37:40 -0400 Subject: [PATCH 4/5] . --- tests/test_initialization.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_initialization.py b/tests/test_initialization.py index 3bc70610..631a41ed 100644 --- a/tests/test_initialization.py +++ b/tests/test_initialization.py @@ -3,9 +3,7 @@ from .helpers import DjangoPytester -def test_django_setup_order_and_uniqueness( - django_pytester: DjangoPytester, -) -> None: +def test_django_setup_order_and_uniqueness(django_pytester: DjangoPytester) -> None: """ The django.setup() function shall not be called multiple times by pytest-django, since it resets logging conf each time. From f3e7d34cecaf1380c963c3e3a00fefb0e236de07 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 05:53:23 -0400 Subject: [PATCH 5/5] Fixes settings --- tests/test_fixtures.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 749fcba2..16a548d4 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -30,6 +30,7 @@ if TYPE_CHECKING: from pytest_django.django_compat import _User, _UserModel + from pytest_django.fixtures import SettingsWrapper from pytest_django.live_server_helper import LiveServer @@ -475,7 +476,11 @@ def test_settings_before(self) -> None: def test_url(self, live_server: LiveServer) -> None: assert live_server.url == force_str(live_server) - def test_change_settings(self, live_server: LiveServer) -> None: + def test_change_settings( + self, + live_server: LiveServer, + settings: SettingsWrapper, # noqa: ARG002 + ) -> None: assert live_server.url == force_str(live_server) @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use")