When a mock is called multiple times (with the right arguments, at some point) but only one call is expected:
def test_foo(mocker):
mock = mocker.Mock()
mock('foo')
mock('test')
mock.assert_called_once_with('test')
the output is:
> mock.assert_called_once_with('test')
E AssertionError: Expected 'mock' to be called once. Called 2 times.
E
E pytest introspection follows:
test_x.py:5: AssertionError
which is kind of confusing.