Skip to content

Commit d08e922

Browse files
committed
Skip sharded client in hashmap tests
1 parent 09e53a1 commit d08e922

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_backend.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,17 @@ def test_clear(self, cache: RedisCache):
799799
assert value_from_cache_after_clear is None
800800

801801
def test_hset(self, cache: RedisCache):
802+
if isinstance(cache.client, ShardClient):
803+
pytest.skip("ShardClient doesn't support get_client")
802804
cache.hset("foo_hash1", "foo1", "bar1")
803805
cache.hset("foo_hash1", "foo2", "bar2")
804806
assert cache.hlen("foo_hash1") == 2
805807
assert cache.hexists("foo_hash1", "foo1")
806808
assert cache.hexists("foo_hash1", "foo2")
807809

808810
def test_hdel(self, cache: RedisCache):
811+
if isinstance(cache.client, ShardClient):
812+
pytest.skip("ShardClient doesn't support get_client")
809813
cache.hset("foo_hash2", "foo1", "bar1")
810814
cache.hset("foo_hash2", "foo2", "bar2")
811815
assert cache.hlen("foo_hash2") == 2
@@ -816,13 +820,17 @@ def test_hdel(self, cache: RedisCache):
816820
assert cache.hexists("foo_hash2", "foo2")
817821

818822
def test_hlen(self, cache: RedisCache):
823+
if isinstance(cache.client, ShardClient):
824+
pytest.skip("ShardClient doesn't support get_client")
819825
assert cache.hlen("foo_hash3") == 0
820826
cache.hset("foo_hash3", "foo1", "bar1")
821827
assert cache.hlen("foo_hash3") == 1
822828
cache.hset("foo_hash3", "foo2", "bar2")
823829
assert cache.hlen("foo_hash3") == 2
824830

825831
def test_hkeys(self, cache: RedisCache):
832+
if isinstance(cache.client, ShardClient):
833+
pytest.skip("ShardClient doesn't support get_client")
826834
cache.hset("foo_hash4", "foo1", "bar1")
827835
cache.hset("foo_hash4", "foo2", "bar2")
828836
cache.hset("foo_hash4", "foo3", "bar3")
@@ -832,6 +840,8 @@ def test_hkeys(self, cache: RedisCache):
832840
assert keys[i] == f"foo{i + 1}"
833841

834842
def test_hexists(self, cache: RedisCache):
843+
if isinstance(cache.client, ShardClient):
844+
pytest.skip("ShardClient doesn't support get_client")
835845
cache.hset("foo_hash5", "foo1", "bar1")
836846
assert cache.hexists("foo_hash5", "foo1")
837847
assert not cache.hexists("foo_hash5", "foo")

0 commit comments

Comments
 (0)