Skip to content

Commit

Permalink
Merge pull request #401 from mgorny/redis-dep
Browse files Browse the repository at this point in the history
skip redis tests if redis package is not installed
  • Loading branch information
gabrielfalcao committed May 14, 2021
2 parents 6b51cbf + 7179453 commit e03ab7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/functional/bugfixes/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
import requests
import httpretty

from redis import Redis
try:
from redis import Redis
except ImportError:
Redis = None

from unittest import skipUnless


def redis_available():
if Redis is None:
return False

params = dict(
host=os.getenv('REDIS_HOST') or '127.0.0.1',
port=int(os.getenv('REDIS_PORT') or 6379)
Expand Down

0 comments on commit e03ab7b

Please sign in to comment.