Skip to content

Commit f1d227d

Browse files
fix: reviewer suggestion
1 parent 290e21f commit f1d227d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/_pytest/_io/pprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
indent: int = 4,
6363
width: int = 80,
6464
depth: int | None = None,
65-
sort_dicts: bool = True,
65+
sort_dicts: bool = False,
6666
) -> None:
6767
"""Handle pretty printing operations onto a stream using a set of
6868
configured parameters.

src/_pytest/assertion/util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ def _compare_eq_iterable(
348348
# dynamic import to speedup pytest
349349
import difflib
350350

351-
left_formatting = PrettyPrinter(sort_dicts=False).pformat(left).splitlines()
352-
right_formatting = PrettyPrinter(sort_dicts=False).pformat(right).splitlines()
351+
left_formatting = PrettyPrinter().pformat(left).splitlines()
352+
right_formatting = PrettyPrinter().pformat(right).splitlines()
353353

354354
explanation = ["", "Full diff:"]
355355
# "right" is the expected base against which we compare "left",
@@ -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, sort_dicts=False)).splitlines()
514+
explanation += highlighter(pprint.pformat(same)).splitlines()
515515
diff = {k for k in common if left[k] != right[k]}
516516
if diff:
517517
explanation += ["Differing items:"]
@@ -532,7 +532,7 @@ def _compare_eq_dict(
532532
explanation.extend(
533533
highlighter(
534534
pprint.pformat(
535-
{k: left[k] for k in left if k in extra_left}, sort_dicts=False
535+
{k: left[k] for k in left if k in extra_left}
536536
)
537537
).splitlines()
538538
)
@@ -545,7 +545,7 @@ def _compare_eq_dict(
545545
explanation.extend(
546546
highlighter(
547547
pprint.pformat(
548-
{k: right[k] for k in right if k in extra_right}, sort_dicts=False
548+
{k: right[k] for k in right if k in extra_right}
549549
)
550550
).splitlines()
551551
)

0 commit comments

Comments
 (0)