diff --git a/pytest.ini b/pytest.ini index f1b716ae96..9db630e5b1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -11,3 +11,6 @@ markers = experimental: run only experimental tests asyncio_mode = auto timeout = 30 +filterwarnings = + always + ignore:RedisGraph support is deprecated as of Redis Stack 7.2:DeprecationWarning diff --git a/tasks.py b/tasks.py index 79b27852e3..0fef093f3c 100644 --- a/tasks.py +++ b/tasks.py @@ -55,11 +55,11 @@ def standalone_tests(c, uvloop=False, protocol=2, profile=False): profile_arg = "--profile" if profile else "" if uvloop: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml" + f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml" ) else: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml" + f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -m 'not onlycluster' --junit-xml=standalone-results.xml" ) @@ -70,11 +70,11 @@ def cluster_tests(c, uvloop=False, protocol=2, profile=False): cluster_url = "redis://localhost:16379/0" if uvloop: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-uvloop-results.xml --uvloop" + f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster.xml -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-uvloop-results.xml --uvloop" ) else: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_clusteclient.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-results.xml" + f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_clusteclient.xml -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-results.xml" ) diff --git a/tests/test_graph.py b/tests/test_graph.py index 680b8af645..c82c5030c8 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -40,6 +40,15 @@ def test_bulk(client): client.graph().bulk(foo="bar!") +@pytest.mark.redismod +def test_graph_creation_throws_deprecation_warning(client): + """Verify that a DeprecationWarning is raised when creating a Graph instance.""" + + match = "RedisGraph support is deprecated as of Redis Stack 7.2" + with pytest.warns(DeprecationWarning, match=match): + client.graph() + + @pytest.mark.redismod @skip_if_resp_version(3) def test_graph_creation(client):