diff options
author | Gabriel Falcão <gabrielfalcao@users.noreply.github.com> | 2021-05-14 02:28:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 02:28:09 +0200 |
commit | e03ab7b9aa37c08d436121ff21d770064a443efd (patch) | |
tree | e2341e1b64035f0599be6a74e48ffc1d60a9222b | |
parent | 6b51cbf4343ba98ba9f46313abfbd908830f4be3 (diff) | |
parent | 717945362852a5039ef68dd9b72e5387d0d25b1f (diff) | |
download | httpretty-e03ab7b9aa37c08d436121ff21d770064a443efd.tar.gz |
Merge pull request #401 from mgorny/redis-dep
skip redis tests if redis package is not installed
-rw-r--r-- | tests/functional/bugfixes/test_redis.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/functional/bugfixes/test_redis.py b/tests/functional/bugfixes/test_redis.py index 11262f0..e7328a4 100644 --- a/tests/functional/bugfixes/test_redis.py +++ b/tests/functional/bugfixes/test_redis.py @@ -2,11 +2,18 @@ import os 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) |