We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71ab6c6 commit d264c71Copy full SHA for d264c71
tests/test_lazy_object_proxy.py
@@ -1622,13 +1622,21 @@ def __qualname__(self):
1622
1623
1624
def test_del_wrapped(lazy_object_proxy):
1625
- class Foo(object):
1626
- pass
1627
- proxy = lazy_object_proxy.Proxy(lambda: Foo)
+ foo = object()
+ called = []
+
1628
+ def make_foo():
1629
+ called.append(1)
1630
+ return foo
1631
1632
+ proxy = lazy_object_proxy.Proxy(make_foo)
1633
str(proxy)
- assert proxy.__wrapped__
1634
+ assert called == [1]
1635
+ assert proxy.__wrapped__ is foo
1636
# print(type(proxy), hasattr(type(proxy), '__wrapped__'))
1637
del proxy.__wrapped__
1638
+ str(proxy)
1639
+ assert called == [1, 1]
1640
1641
1642
def test_raise_attribute_error(lazy_object_proxy):
0 commit comments