MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_set_reprs

Method test_set_reprs

Lib/test/test_pprint.py:587–629  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

585 self.assertEqual(dotted_printer.pformat(o2), exp2)
586
587 def test_set_reprs(self):
588 self.assertEqual(pprint.pformat(set()), 'set()')
589 self.assertEqual(pprint.pformat(set(range(3))), '{0, 1, 2}')
590 self.assertEqual(pprint.pformat(set(range(7)), width=20), '''\
591{0,
592 1,
593 2,
594 3,
595 4,
596 5,
597 6}''')
598 self.assertEqual(pprint.pformat(set2(range(7)), width=20), '''\
599set2({0,
600 1,
601 2,
602 3,
603 4,
604 5,
605 6})''')
606 self.assertEqual(pprint.pformat(set3(range(7)), width=20),
607 'set3({0, 1, 2, 3, 4, 5, 6})')
608
609 self.assertEqual(pprint.pformat(frozenset()), 'frozenset()')
610 self.assertEqual(pprint.pformat(frozenset(range(3))),
611 'frozenset({0, 1, 2})')
612 self.assertEqual(pprint.pformat(frozenset(range(7)), width=20), '''\
613frozenset({0,
614 1,
615 2,
616 3,
617 4,
618 5,
619 6})''')
620 self.assertEqual(pprint.pformat(frozenset2(range(7)), width=20), '''\
621frozenset2({0,
622 1,
623 2,
624 3,
625 4,
626 5,
627 6})''')
628 self.assertEqual(pprint.pformat(frozenset3(range(7)), width=20),
629 'frozenset3({0, 1, 2, 3, 4, 5, 6})')
630
631 def test_set_of_sets_reprs(self):
632 # This test creates a complex arrangement of frozensets and

Callers

nothing calls this directly

Calls 7

setFunction · 0.85
set2Class · 0.85
set3Class · 0.85
frozenset2Class · 0.85
frozenset3Class · 0.85
pformatMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected