mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
85e4235c0e
commit
047f14c3c6
3 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue