Skip to content

Commit 6f8ca31

Browse files
committed
Address review
1 parent bcc2e77 commit 6f8ca31

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Lib/test/test_pprint.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -648,27 +648,24 @@ def test_set_of_sets_reprs(self):
648648
import textwrap
649649

650650
# Single-line, always ordered:
651-
data = frozenset((frozenset(), frozenset((1, 2, 3))))
652-
self.assertEqual(
653-
pprint.pformat(data),
654-
'frozenset({frozenset(), frozenset({1, 2, 3})})',
655-
)
651+
fs0 = frozenset()
652+
fs1 = frozenset(('abc', 'xyz'))
653+
data = frozenset((fs0, fs1))
654+
self.assertEqual(pprint.pformat(data),
655+
'frozenset({%r, %r})' % (fs0, fs1))
656656
self.assertEqual(pprint.pformat(data), repr(data))
657657

658-
data = {
659-
frozenset((1, 2)): frozenset((frozenset(), frozenset((1, 2, 3)))),
660-
}
661-
self.assertEqual(
662-
pprint.pformat(data),
663-
'{frozenset({1, 2}): frozenset({frozenset(), frozenset({1, 2, 3})})}',
664-
)
658+
fs2 = frozenset(('one', 'two'))
659+
data = {fs2: frozenset((fs0, fs1))}
660+
self.assertEqual(pprint.pformat(data),
661+
"{%r: frozenset({%r, %r})}" % (fs2, fs0, fs1))
665662
self.assertEqual(pprint.pformat(data), repr(data))
666663

667664
# Single-line, unordered:
668665
fs1 = frozenset(("xyz", "qwerty"))
669666
fs2 = frozenset(("abcd", "spam"))
670-
fs = frozenset((fs1, fs2)))
671-
self.assertEqual(pprint.pformat(fs, repr(fs))
667+
fs = frozenset((fs1, fs2))
668+
self.assertEqual(pprint.pformat(fs), repr(fs))
672669

673670
# Multiline, unordered:
674671
def check(res, invariants):

0 commit comments

Comments
 (0)