Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress Graph deprecation warning in test suite #3316

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)


Expand All @@ -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"
)


Expand Down
9 changes: 9 additions & 0 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading