mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-77757: replace exception wrapping by PEP-678 notes in typeobject's __set_name__ (#103402)
This commit is contained in:
parent
e071f00aae
commit
55c99d97e1
8 changed files with 55 additions and 41 deletions
|
@ -2980,7 +2980,7 @@ class TestCachedProperty(unittest.TestCase):
|
|||
|
||||
def test_reuse_different_names(self):
|
||||
"""Disallow this case because decorated function a would not be cached."""
|
||||
with self.assertRaises(RuntimeError) as ctx:
|
||||
with self.assertRaises(TypeError) as ctx:
|
||||
class ReusedCachedProperty:
|
||||
@py_functools.cached_property
|
||||
def a(self):
|
||||
|
@ -2989,7 +2989,7 @@ class TestCachedProperty(unittest.TestCase):
|
|||
b = a
|
||||
|
||||
self.assertEqual(
|
||||
str(ctx.exception.__context__),
|
||||
str(ctx.exception),
|
||||
str(TypeError("Cannot assign the same cached_property to two different names ('a' and 'b')."))
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue