Skip to content

Commit 599515c

Browse files
committed
Store REDIS_INFO in config object, where it is available from condition strings
1 parent 699ec35 commit 599515c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def pytest_sessionstart(session):
139139
REDIS_INFO["arch_bits"] = arch_bits
140140
REDIS_INFO["cluster_enabled"] = cluster_enabled
141141
REDIS_INFO["enterprise"] = info["enterprise"]
142+
# store REDIS_INFO in config so that it is available from "condition strings"
143+
session.config.REDIS_INFO = REDIS_INFO
142144

143145
# module info, if the second redis is running
144146
try:

tests/test_asyncio/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ async def _get_info(redis_url):
3939
pytest.param(
4040
(True, PythonParser),
4141
marks=pytest.mark.skipif(
42-
'REDIS_INFO["cluster_enabled"]', reason="cluster mode enabled"
42+
'config.REDIS_INFO["cluster_enabled"]', reason="cluster mode enabled"
4343
),
4444
),
4545
(False, PythonParser),
4646
pytest.param(
4747
(True, HiredisParser),
4848
marks=pytest.mark.skipif(
49-
not HIREDIS_AVAILABLE or 'REDIS_INFO["cluster_enabled"]',
49+
not HIREDIS_AVAILABLE or 'config.REDIS_INFO["cluster_enabled"]',
5050
reason="hiredis is not installed or cluster mode enabled",
5151
),
5252
),

0 commit comments

Comments
 (0)