Skip to content

Commit 9a0615d

Browse files
author
Michael Brewer
committed
tests(LRUDict): Add passing del test
1 parent 303a44d commit 9a0615d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/unit/test_lru_cache.py

+11
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ def test_lru_pop_failing():
6767
pytest.fail("GitHub #300: LRUDict pop bug has been fixed :)")
6868
except KeyError as e:
6969
assert e.args[0] == key
70+
71+
72+
def test_lru_del():
73+
cache = LRUDict()
74+
key = "test"
75+
cache[key] = "value"
76+
assert len(cache) == 1
77+
if key in cache:
78+
del cache[key]
79+
assert key not in cache
80+
assert len(cache) == 0

0 commit comments

Comments
 (0)