Skip to content

Commit 95ce03d

Browse files
committed
Fix tests and utils
1 parent d74ebfa commit 95ce03d

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

cachebox/utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,14 @@ def _wrapped(*args, **kwds):
484484

485485
if not cache_is_fn:
486486
_wrapped.cache = cache # type: ignore[attr-defined]
487-
_wrapped.cache_info = lambda: CacheInfo(hits, misses, cache.maxsize, len(cache)) # type: ignore[attr-defined]
487+
_wrapped.cache_info = lambda: CacheInfo( # type: ignore[attr-defined]
488+
hits,
489+
misses,
490+
cache.maxsize,
491+
cache.current_size(),
492+
len(cache),
493+
cache.__sizeof__(),
494+
)
488495

489496
def cache_clear() -> None:
490497
nonlocal hits, misses

tests/test_impls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def test_clear_resets_fifo_order(self):
306306
assert cache.last() == 30
307307

308308
@pytest.mark.skipif(
309-
cachebox._small_offset_feature,
309+
not cachebox._small_offset_feature,
310310
reason="requires small-offset feature flag",
311311
)
312312
def test_edge_case_of_front_offset_overflow(self):
@@ -1160,7 +1160,7 @@ def test_clear_resets_fifo_order(self):
11601160
assert cache.last() == 30
11611161

11621162
@pytest.mark.skipif(
1163-
cachebox._small_offset_feature,
1163+
not cachebox._small_offset_feature,
11641164
reason="requires small-offset feature flag",
11651165
)
11661166
def test_edge_case_of_front_offset_overflow(self):

0 commit comments

Comments
 (0)