check unittest.mock call arguments agnostically w.r.t. whether they have been passed as positional arguments or keyword arguments
问题 When a unittest.mock.Mock object has been called, I can check for the argument values with the exact signature of the call: from unittest.mock import Mock m = Mock() # creation of mock m('foo', bar='baz') # call to the mock m.assert_called_once_with('foo', bar='baz') # check call arguments Checking for a different signature with the same values will fail. E.g., if we check with 'baz' as a positional argument instead of a named argument, the assertion will fail: m.assert_called_once_with('foo'