diff options
Diffstat (limited to 'Lib/test/test_property.py')
-rw-r--r-- | Lib/test/test_property.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_property.py b/Lib/test/test_property.py index 7f3813fc8c..7d1c4a1e12 100644 --- a/Lib/test/test_property.py +++ b/Lib/test/test_property.py @@ -322,27 +322,27 @@ class _PropertyUnreachableAttribute: cls.obj = cls.cls() def test_get_property(self): - with self.assertRaisesRegex(AttributeError, self._format_exc_msg("unreadable attribute")): + with self.assertRaisesRegex(AttributeError, self._format_exc_msg("has no getter")): self.obj.foo def test_set_property(self): - with self.assertRaisesRegex(AttributeError, self._format_exc_msg("can't set attribute")): + with self.assertRaisesRegex(AttributeError, self._format_exc_msg("has no setter")): self.obj.foo = None def test_del_property(self): - with self.assertRaisesRegex(AttributeError, self._format_exc_msg("can't delete attribute")): + with self.assertRaisesRegex(AttributeError, self._format_exc_msg("has no deleter")): del self.obj.foo class PropertyUnreachableAttributeWithName(_PropertyUnreachableAttribute, unittest.TestCase): - msg_format = "^{} 'foo'$" + msg_format = r"^property 'foo' of 'PropertyUnreachableAttributeWithName\.cls' object {}$" class cls: foo = property() class PropertyUnreachableAttributeNoName(_PropertyUnreachableAttribute, unittest.TestCase): - msg_format = "^{}$" + msg_format = "^property of 'PropertyUnreachableAttributeNoName\.cls' object {}$" class cls: pass |