Skip to content

late eval of the skip condition #2248

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

Merged
merged 3 commits into from
Jun 27, 2022
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
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def pytest_sessionstart(session):
REDIS_INFO["arch_bits"] = arch_bits
REDIS_INFO["cluster_enabled"] = cluster_enabled
REDIS_INFO["enterprise"] = info["enterprise"]
# store REDIS_INFO in config so that it is available from "condition strings"
session.config.REDIS_INFO = REDIS_INFO

# module info, if the second redis is running
try:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_asyncio/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ async def _get_info(redis_url):
pytest.param(
(True, PythonParser),
marks=pytest.mark.skipif(
REDIS_INFO["cluster_enabled"], reason="cluster mode enabled"
'config.REDIS_INFO["cluster_enabled"]', reason="cluster mode enabled"
),
),
(False, PythonParser),
pytest.param(
(True, HiredisParser),
marks=pytest.mark.skipif(
not HIREDIS_AVAILABLE or REDIS_INFO["cluster_enabled"],
not HIREDIS_AVAILABLE or 'config.REDIS_INFO["cluster_enabled"]',
reason="hiredis is not installed or cluster mode enabled",
),
),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_asyncio/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def test_add(modclient: redis.Redis):
4, 4, 2, retention_msecs=10, labels={"Redis": "Labs", "Time": "Series"}
)
res = await modclient.ts().add(5, "*", 1)
assert round(time.time()) == round(float(res) / 1000)
assert abs(time.time() - round(float(res) / 1000)) < 1.0

info = await modclient.ts().info(4)
assert 10 == info.retention_msecs
Expand Down
3 changes: 2 additions & 1 deletion tests/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def test_add(client):
assert 4 == client.ts().add(
4, 4, 2, retention_msecs=10, labels={"Redis": "Labs", "Time": "Series"}
)
assert round(time.time()) == round(float(client.ts().add(5, "*", 1)) / 1000)

assert abs(time.time() - float(client.ts().add(5, "*", 1)) / 1000) < 1.0

info = client.ts().info(4)
assert 10 == info.retention_msecs
Expand Down