diff options
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r-- | Lib/unittest/mock.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index ef5c55d6a1..8f46050462 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -745,7 +745,7 @@ class NonCallableMock(Base): def _format_mock_failure_message(self, args, kwargs): - message = 'Expected call: %s\nActual call: %s' + message = 'expected call not found.\nExpected: %s\nActual: %s' expected_string = self._format_mock_call_signature(args, kwargs) call_args = self.call_args if len(call_args) == 3: @@ -814,7 +814,10 @@ class NonCallableMock(Base): self = _mock_self if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) - raise AssertionError('Expected call: %s\nNot called' % (expected,)) + actual = 'not called.' + error_message = ('expected call not found.\nExpected: %s\nActual: %s' + % (expected, actual)) + raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) |