Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
tests: update regexes for Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
horazont committed Jan 29, 2023
1 parent 702c2ec commit 05fc48d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_utils.py
Expand Up @@ -763,7 +763,10 @@ def test_forwards_writes(self):
def test_rejects_deletes_by_default(self):
self.assertTrue(hasattr(self.obj.member, "attr"))

with self.assertRaisesRegex(AttributeError, "can't delete attribute"):
with self.assertRaisesRegex(
AttributeError,
r"(can't delete attribute|property of .* has no deleter)"
):
self.pp.__delete__(self.obj)

self.assertTrue(hasattr(self.obj.member, "attr"))
Expand All @@ -773,7 +776,10 @@ def test_rejects_writes_if_readonly(self):

pp = utils.proxy_property("member", "attr", readonly=True)

with self.assertRaisesRegex(AttributeError, "can't set attribute"):
with self.assertRaisesRegex(
AttributeError,
r"(can't set attribute|property of .* has no setter)"
):
pp.__set__(self.obj, unittest.mock.sentinel.value)

self.assertEqual(
Expand Down

0 comments on commit 05fc48d

Please sign in to comment.