Add minimum Redis server version to TestPubSubPubSubSubcommands
@@ -7,6 +7,7 @@ from redis.exceptions import ConnectionError
from redis._compat import basestring, u, unichr, b
from .conftest import r as _redis_client
+from .conftest import skip_if_server_version_lt
def wait_for_message(pubsub, timeout=0.1, ignore_subscribe_messages=False):
@@ -402,12 +403,14 @@ class TestPubSubRedisDown(object):
class TestPubSubPubSubSubcommands(object):
+ @skip_if_server_version_lt('2.8.0')
def test_pubsub_channels(self, r):
p = r.pubsub(ignore_subscribe_messages=True)
p.subscribe('foo', 'bar', 'baz', 'quux')
channels = sorted(r.pubsub_channels())
assert channels == [b('bar'), b('baz'), b('foo'), b('quux')]
+ @skip_if_server_version_lt('2.8.0')
def test_pubsub_numsub(self, r):
p1 = r.pubsub(ignore_subscribe_messages=True)
p1.subscribe('foo', 'bar', 'baz')
@@ -419,6 +422,7 @@ class TestPubSubPubSubSubcommands(object):
channels = [(b('foo'), 1), (b('bar'), 2), (b('baz'), 3)]
assert channels == r.pubsub_numsub('foo', 'bar', 'baz')
+ @skip_if_server_version_lt('2.8.0')
def test_pubsub_numpat(self, r):
p = r.pubsub(ignore_subscribe_messages=True)
p.psubscribe('*oo', '*ar', 'b*z')
