Skip to content

Commit 0a2ca0d

Browse files
committed
Run herd tests.
1 parent 7284dac commit 0a2ca0d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ REDIS =
100100
passenv = CI GITHUB*
101101
commands =
102102
{envpython} -m pytest --cov-report= --ds=settings.sqlite {posargs}
103+
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_herd {posargs}
103104
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_json {posargs}
104105
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_lz4 {posargs}
105106
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_msgpack {posargs}

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
from typing import Iterable
22

33
import pytest
4+
from pytest_django.fixtures import SettingsWrapper
45
from django.core.cache import cache as default_cache
56

67
from django_redis.cache import BaseCache
78

89

10+
@pytest.fixture(autouse=True)
11+
def patch_settings(settings: SettingsWrapper):
12+
settings.CACHE_HERD_TIMEOUT = 2
13+
14+
915
@pytest.fixture
1016
def cache() -> Iterable[BaseCache]:
1117
yield default_cache

tests/test_backend.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ def test_set_many(self, cache: RedisCache):
199199
def test_set_call_empty_pipeline(
200200
self, cache: RedisCache, mocker: MockerFixture, settings: SettingsWrapper
201201
):
202-
settings.CACHE_HERD_TIMEOUT = 2
203-
204202
if isinstance(cache.client, ShardClient):
205203
pytest.skip("ShardClient doesn't support get_client")
206204

0 commit comments

Comments
 (0)