diff --git a/tests/test_backend.py b/tests/test_backend.py index d654a1b7..550ce79c 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -799,6 +799,8 @@ def test_clear(self, cache: RedisCache): assert value_from_cache_after_clear is None def test_hset(self, cache: RedisCache): + if isinstance(cache.client, ShardClient): + pytest.skip("ShardClient doesn't support get_client") cache.hset("foo_hash1", "foo1", "bar1") cache.hset("foo_hash1", "foo2", "bar2") assert cache.hlen("foo_hash1") == 2 @@ -806,6 +808,8 @@ def test_hset(self, cache: RedisCache): assert cache.hexists("foo_hash1", "foo2") def test_hdel(self, cache: RedisCache): + if isinstance(cache.client, ShardClient): + pytest.skip("ShardClient doesn't support get_client") cache.hset("foo_hash2", "foo1", "bar1") cache.hset("foo_hash2", "foo2", "bar2") assert cache.hlen("foo_hash2") == 2 @@ -816,6 +820,8 @@ def test_hdel(self, cache: RedisCache): assert cache.hexists("foo_hash2", "foo2") def test_hlen(self, cache: RedisCache): + if isinstance(cache.client, ShardClient): + pytest.skip("ShardClient doesn't support get_client") assert cache.hlen("foo_hash3") == 0 cache.hset("foo_hash3", "foo1", "bar1") assert cache.hlen("foo_hash3") == 1 @@ -823,6 +829,8 @@ def test_hlen(self, cache: RedisCache): assert cache.hlen("foo_hash3") == 2 def test_hkeys(self, cache: RedisCache): + if isinstance(cache.client, ShardClient): + pytest.skip("ShardClient doesn't support get_client") cache.hset("foo_hash4", "foo1", "bar1") cache.hset("foo_hash4", "foo2", "bar2") cache.hset("foo_hash4", "foo3", "bar3") @@ -832,6 +840,8 @@ def test_hkeys(self, cache: RedisCache): assert keys[i] == f"foo{i + 1}" def test_hexists(self, cache: RedisCache): + if isinstance(cache.client, ShardClient): + pytest.skip("ShardClient doesn't support get_client") cache.hset("foo_hash5", "foo1", "bar1") assert cache.hexists("foo_hash5", "foo1") assert not cache.hexists("foo_hash5", "foo")