Skip to content

Commit

Permalink
Fix async tests #154
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed May 22, 2023
1 parent 749ab40 commit ced6ff6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_redis_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
)
async def _req_aioredis2(request) -> redis.asyncio.Redis:
server_version = request.getfixturevalue('real_redis_version')
if request.param != 'fake' and not server_version:
pytest.skip('Redis is not running')
server_version = server_version or '6'
min_server_marker = _marker_version_value(request, 'min_server')
max_server_marker = _marker_version_value(request, 'max_server')
if Version(server_version) < min_server_marker:
Expand All @@ -48,8 +51,6 @@ async def _req_aioredis2(request) -> redis.asyncio.Redis:
fake_server = request.getfixturevalue('fake_server')
ret = aioredis.FakeRedis(server=fake_server)
else:
if not server_version:
pytest.skip('Redis is not running')
ret = redis.asyncio.Redis()
fake_server = None
if not fake_server or fake_server.connected:
Expand Down

0 comments on commit ced6ff6

Please sign in to comment.