Skip to content
Merged
Prev Previous commit
Next Next commit
bpo-46730: Fix regex dot in tests
Properly escape dot character and return `_format_exc_msg` function to its initial state.
  • Loading branch information
Alexander Lakeev committed Feb 14, 2022
commit f1cae0c1aca92ffaa13491d9fba3a48dd02386e2
8 changes: 4 additions & 4 deletions Lib/test/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ class _PropertyUnreachableAttribute:
obj = None
cls = None

def _format_exc_msg(self, *msg):
return self.msg_format.format(*msg)
def _format_exc_msg(self, msg):
return self.msg_format.format(msg)

@classmethod
def setUpClass(cls):
Expand All @@ -335,14 +335,14 @@ def test_del_property(self):


class PropertyUnreachableAttributeWithName(_PropertyUnreachableAttribute, unittest.TestCase):
msg_format = "^property 'foo' in object of type 'PropertyUnreachableAttributeWithName.cls' {}$"
msg_format = r"^property 'foo' in object of type 'PropertyUnreachableAttributeWithName\.cls' {}$"

class cls:
foo = property()


class PropertyUnreachableAttributeNoName(_PropertyUnreachableAttribute, unittest.TestCase):
msg_format = "^property in object of type 'PropertyUnreachableAttributeNoName.cls' {}$"
msg_format = "^property in object of type 'PropertyUnreachableAttributeNoName\.cls' {}$"

class cls:
pass
Expand Down