Skip to content

Commit

Permalink
fix test env
Browse files Browse the repository at this point in the history
  • Loading branch information
turalpb committed Jan 5, 2022
1 parent 0702afc commit edf2b4a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cache_house/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.4'
__version__ = '0.1.6'
9 changes: 7 additions & 2 deletions cache_house/backends/redis_cluster_backend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from typing import Any, Callable
import fakeredis


from redis.cluster import RedisCluster
from redis.exceptions import RedisClusterException
Expand All @@ -13,6 +13,11 @@
pickle_encoder,
)

try:
from fakeredis import FakeRedis
except ImportError:
FakeRedis = None

log = logging.getLogger(__name__)


Expand Down Expand Up @@ -57,7 +62,7 @@ def __init__(
**kwargs,
)

if not isinstance(self.redis, fakeredis.FakeRedis):
if FakeRedis is None:
log.info(f"redis cluster nodes {self.redis.get_nodes()}")
log.info("redis cluster initalized")
RedisClusterCache.instance = self
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cache_house"
version = "0.1.4"
version = "0.1.6"
description = ""
readme = "README.md"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="cache_house",
version="0.1.4",
version="0.1.6",
author="Tural Muradov",
author_email="[email protected]",
description="",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cache_house.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def custom_key_builder():


def test_version():
assert __version__ == "0.1.4"
assert __version__ == "0.1.6"


@patch("cache_house.backends.redis_backend.Redis", FakeRedis)
Expand Down

0 comments on commit edf2b4a

Please sign in to comment.