diff options
author | Kushal Das <kushaldas@gmail.com> | 2014-06-09 08:15:56 (GMT) |
---|---|---|
committer | Kushal Das <kushaldas@gmail.com> | 2014-06-09 08:15:56 (GMT) |
commit | 047f14c3c6ed39371fab2d93db8dfd5b5fdb06f1 (patch) | |
tree | c3b9bd6d71958bed15ed603d96dca6761d82c928 /Lib/unittest/mock.py | |
parent | 85e4235c0e702b180f3f50b0124fd40c2f460be0 (diff) | |
download | cpython-047f14c3c6ed39371fab2d93db8dfd5b5fdb06f1.zip cpython-047f14c3c6ed39371fab2d93db8dfd5b5fdb06f1.tar.gz cpython-047f14c3c6ed39371fab2d93db8dfd5b5fdb06f1.tar.bz2 |
Closes #21256: Printout of keyword args in deterministic order in mock calls.
Printout of keyword args should be in deterministic order in
a mock function call. This will help to write better doctests.
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r-- | Lib/unittest/mock.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index d9c2ee9..d001976 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1894,7 +1894,7 @@ def _format_call_signature(name, args, kwargs): formatted_args = '' args_string = ', '.join([repr(arg) for arg in args]) kwargs_string = ', '.join([ - '%s=%r' % (key, value) for key, value in kwargs.items() + '%s=%r' % (key, value) for key, value in sorted(kwargs.items()) ]) if args_string: formatted_args = args_string |