mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-103272: regression test for getattr exception in property (#103336)
This commit is contained in:
parent
a90863c993
commit
5d7d86f2fd
1 changed files with 13 additions and 0 deletions
|
@ -5003,6 +5003,19 @@ order (MRO) for bases """
|
|||
gc.collect()
|
||||
self.assertEqual(Parent.__subclasses__(), [])
|
||||
|
||||
def test_attr_raise_through_property(self):
|
||||
# add test case for gh-103272
|
||||
class A:
|
||||
def __getattr__(self, name):
|
||||
raise ValueError("FOO")
|
||||
|
||||
@property
|
||||
def foo(self):
|
||||
return self.__getattr__("asdf")
|
||||
|
||||
with self.assertRaisesRegex(ValueError, "FOO"):
|
||||
A().foo
|
||||
|
||||
|
||||
class DictProxyTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue