Skip to content

Commit be32456

Browse files
committed
✅ increase test coverage for WeakWrapper by adding a test for repr including value when proxy is alive
1 parent f56798e commit be32456

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/unit/weakref_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ def test_wrappers_for_different_objects_are_not_equal(self) -> None:
5252
# hashes match because contents match
5353
assert hash(w1) == hash(w2)
5454

55+
def test_repr_includes_value_when_proxy_alive(self) -> None:
56+
wrapper = WeakWrapper({"k": "v"})
57+
text = repr(wrapper)
58+
assert text.startswith("WeakWrapper(") and "'v'" in text
59+
5560
def test_hash_handles_sets(self) -> None:
5661
s1 = {"a", "b"}
5762
s2 = {"b", "a"}

0 commit comments

Comments
 (0)