Skip to content

Commit 581df6f

Browse files
committed
tests
1 parent c4f2da6 commit 581df6f

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

tests/test_pickle_core.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from cachier import cachier
3636
from cachier.config import CacheEntry, _global_params
3737
from cachier.cores.pickle import _PickleCore
38+
from cachier.cores.redis import _RedisCore
3839

3940

4041
def _get_decorated_func(func, **kwargs):
@@ -1088,7 +1089,7 @@ def mock_func():
10881089

10891090
@pytest.mark.pickle
10901091
def test_loading_pickle(temp_dir):
1091-
"""Cover the internal _loading_pickle behavior for valid, corrupted, and missing files."""
1092+
"""Cover for valid, corrupted, and missing files."""
10921093
import importlib
10931094

10941095
pickle_module = importlib.import_module("cachier.cores.pickle")
@@ -1119,7 +1120,6 @@ def test_loading_pickle(temp_dir):
11191120

11201121

11211122
# Redis core static method tests
1122-
@pytest.mark.skipif(not REDIS_AVAILABLE, reason="Redis not available")
11231123
def test_redis_loading_pickle():
11241124
"""Test _RedisCore._loading_pickle with various inputs and exceptions."""
11251125
# Valid bytes
@@ -1152,7 +1152,6 @@ def test_redis_loading_pickle():
11521152
mock_warn.assert_called_once()
11531153

11541154

1155-
@pytest.mark.skipif(not REDIS_AVAILABLE, reason="Redis not available")
11561155
def test_redis_get_raw_field():
11571156
"""Test _RedisCore._get_raw_field with bytes and string keys."""
11581157
# Test with bytes key
@@ -1168,7 +1167,6 @@ def test_redis_get_raw_field():
11681167
assert _RedisCore._get_raw_field(cached_data, "field") is None
11691168

11701169

1171-
@pytest.mark.skipif(not REDIS_AVAILABLE, reason="Redis not available")
11721170
def test_redis_get_bool_field():
11731171
"""Test _RedisCore._get_bool_field with various inputs and exceptions."""
11741172
# Test with bytes "true"
@@ -1195,4 +1193,3 @@ def test_redis_get_bool_field():
11951193
# Test with non-string/bytes value
11961194
cached_data = {b"flag": 123}
11971195
assert _RedisCore._get_bool_field(cached_data, "flag") is False
1198-

0 commit comments

Comments
 (0)