Skip to content

Commit 1f051d6

Browse files
committed
Allow test discovery without active connection
1 parent a49e656 commit 1f051d6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def pytest_sessionstart(session):
131131
enterprise = info["enterprise"]
132132
except redis.ConnectionError:
133133
# provide optimistic defaults
134+
info = {}
134135
version = "10.0.0"
135136
arch_bits = 64
136137
cluster_enabled = False
@@ -145,9 +146,7 @@ def pytest_sessionstart(session):
145146
# module info
146147
try:
147148
REDIS_INFO["modules"] = info["modules"]
148-
except redis.exceptions.ConnectionError:
149-
pass
150-
except KeyError:
149+
except (KeyError, redis.exceptions.ConnectionError):
151150
pass
152151

153152
if cluster_enabled:

0 commit comments

Comments
 (0)