summaryrefslogtreecommitdiff
path: root/Lib/unittest/test/testmock/testmock.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/testmock/testmock.py')
-rw-r--r--Lib/unittest/test/testmock/testmock.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py
index 5f917dd20f..b20b8e20e7 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -1453,9 +1453,10 @@ class MockTest(unittest.TestCase):
#Issue21238
def test_mock_unsafe(self):
m = Mock()
- with self.assertRaises(AttributeError):
+ msg = "Attributes cannot start with 'assert' or 'assret'"
+ with self.assertRaisesRegex(AttributeError, msg):
m.assert_foo_call()
- with self.assertRaises(AttributeError):
+ with self.assertRaisesRegex(AttributeError, msg):
m.assret_foo_call()
m = Mock(unsafe=True)
m.assert_foo_call()