summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_lazyobject.py
diff options
context:
space:
mode:
authorMatthias Kestenholz <mk@feinheit.ch>2022-02-17 09:45:34 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-17 14:52:17 +0100
commitb2ed0d78f2dff9986ef15b9098c1b6d9ce720a99 (patch)
treeaa2afcb3c59b19d538ca6c281c83e6aeacf48f43 /tests/utils_tests/test_lazyobject.py
parenta94ae4cb11b2b6a6fffb26f5a2dfd0c665e2070d (diff)
Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().
Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
Diffstat (limited to 'tests/utils_tests/test_lazyobject.py')
-rw-r--r--tests/utils_tests/test_lazyobject.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils_tests/test_lazyobject.py b/tests/utils_tests/test_lazyobject.py
index 161c9dbcec..134ae77750 100644
--- a/tests/utils_tests/test_lazyobject.py
+++ b/tests/utils_tests/test_lazyobject.py
@@ -58,6 +58,14 @@ class LazyObjectTestCase(TestCase):
obj = self.lazy_wrap(Foo())
self.assertEqual(obj.foo, "bar")
+ def test_getattr_falsey(self):
+ class Thing:
+ def __getattr__(self, key):
+ return []
+
+ obj = self.lazy_wrap(Thing())
+ self.assertEqual(obj.main, [])
+
def test_setattr(self):
obj = self.lazy_wrap(Foo())
obj.foo = "BAR"