Skip to content

Commit e486bb6

Browse files
committed
Only one yield.
1 parent 9992d6b commit e486bb6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_backend.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
@pytest.fixture
2121
def patch_herd_settings():
2222
default_cache = caches["default"]
23-
if not isinstance(default_cache.client, herd.HerdClient):
23+
if isinstance(default_cache.client, herd.HerdClient):
24+
# destroy cache to force recreation with updated settings
25+
del caches["default"]
26+
with override_settings(CACHE_HERD_TIMEOUT=2):
27+
yield
28+
# destroy cache force recreation with original settings
29+
del caches["default"]
30+
else:
2431
yield
2532

26-
# destroy cache to force recreation with updated settings
27-
del caches["default"]
28-
with override_settings(CACHE_HERD_TIMEOUT=2):
29-
yield
30-
# destroy cache force recreation with original settings
31-
del caches["default"]
32-
3333

3434
class TestDjangoRedisCache:
3535
def test_setnx(self, cache: RedisCache):

0 commit comments

Comments
 (0)