File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -511,7 +511,7 @@ def _compare_eq_dict(
511511 elif same :
512512 explanation += ["Common items:" ]
513513 # Common items are displayed in the order of the left dict
514- explanation += highlighter (pprint .pformat (same )).splitlines ()
514+ explanation += highlighter (pprint .pformat (same , sort_dicts = False )).splitlines ()
515515 diff = {k for k in common if left [k ] != right [k ]}
516516 if diff :
517517 explanation += ["Differing items:" ]
@@ -531,7 +531,9 @@ def _compare_eq_dict(
531531 )
532532 explanation .extend (
533533 highlighter (
534- pprint .pformat ({k : left [k ] for k in left if k in extra_left })
534+ pprint .pformat (
535+ {k : left [k ] for k in left if k in extra_left }, sort_dicts = False
536+ )
535537 ).splitlines ()
536538 )
537539 extra_right = set_right - set_left
@@ -542,7 +544,9 @@ def _compare_eq_dict(
542544 )
543545 explanation .extend (
544546 highlighter (
545- pprint .pformat ({k : right [k ] for k in right if k in extra_right })
547+ pprint .pformat (
548+ {k : right [k ] for k in right if k in extra_right }, sort_dicts = False
549+ )
546550 ).splitlines ()
547551 )
548552 return explanation
You can’t perform that action at this time.
0 commit comments