mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-41877: Improve docs for assert misspellings check in mock (GH-23729)
This is a follow-up to
4662fa9bfe
.
That original commit expanded guards against misspelling assertions on
mocks. This follow-up updates the documentation and improves the error
message by pointing out the potential cause and solution.
Automerge-Triggered-By: GH:gpshead
This commit is contained in:
parent
b5c7b38f5e
commit
9fc571359a
4 changed files with 9 additions and 6 deletions
|
@ -1598,7 +1598,7 @@ class MockTest(unittest.TestCase):
|
|||
#Issue21238
|
||||
def test_mock_unsafe(self):
|
||||
m = Mock()
|
||||
msg = "Attributes cannot start with 'assert' or its misspellings"
|
||||
msg = "is not a valid assertion. Use a spec for the mock"
|
||||
with self.assertRaisesRegex(AttributeError, msg):
|
||||
m.assert_foo_call()
|
||||
with self.assertRaisesRegex(AttributeError, msg):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue