Skip to content

Commit 303a44d

Browse files
author
Michael Brewer
committed
tests(LRUDict): Add failing test
1 parent e0cc7c4 commit 303a44d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: tests/unit/test_lru_cache.py

+11
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ def test_setitem_moves_to_end(populated_cache):
5656

5757
assert last_item == f"key_{random_value}"
5858
assert populated_cache[f"key_{random_value}"] == f"new_val_{random_value}"
59+
60+
61+
def test_lru_pop_failing():
62+
cache = LRUDict()
63+
key = "test"
64+
cache[key] = "value"
65+
try:
66+
cache.pop(key, None)
67+
pytest.fail("GitHub #300: LRUDict pop bug has been fixed :)")
68+
except KeyError as e:
69+
assert e.args[0] == key

0 commit comments

Comments
 (0)