Skip to content

Commit cfdd96f

Browse files
committed
Use override_settings instead of pytest test settings.
1 parent 113c294 commit cfdd96f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import pytest
99
from django.core.cache import caches
10+
from django.test import override_settings
1011
from pytest_django.fixtures import SettingsWrapper
1112
from pytest_mock import MockerFixture
1213

@@ -493,14 +494,13 @@ def test_delete_pattern_with_custom_count(self, client_mock, cache: RedisCache):
493494
client_mock.delete_pattern.assert_called_once_with("*foo-a*", itersize=2)
494495

495496
@patch("django_redis.cache.RedisCache.client")
497+
@override_settings(DJANGO_REDIS_SCAN_ITERSIZE=30)
496498
def test_delete_pattern_with_settings_default_scan_count(
497499
self,
498500
client_mock,
499501
cache: RedisCache,
500502
settings: SettingsWrapper,
501503
):
502-
settings.DJANGO_REDIS_SCAN_ITERSIZE = 30
503-
504504
for key in ["foo-aa", "foo-ab", "foo-bb", "foo-bc"]:
505505
cache.set(key, "foo")
506506
expected_count = settings.DJANGO_REDIS_SCAN_ITERSIZE

0 commit comments

Comments
 (0)