MCPcopy Index your code
hub / github.com/python/cpython / test_sort_dict

Method test_sort_dict

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

Source from the content-addressed store, hash-verified

517 r"{5: [[]], 'xy\tab\n': (3,), (): {}}")
518
519 def test_sort_dict(self):
520 d = dict.fromkeys('cba')
521 self.assertEqual(pprint.pformat(d, sort_dicts=False), "{'c': None, 'b': None, 'a': None}")
522 self.assertEqual(pprint.pformat([d, d], sort_dicts=False),
523 "[{'c': None, 'b': None, 'a': None}, {'c': None, 'b': None, 'a': None}]")
524
525 def test_ordered_dict(self):
526 d = collections.OrderedDict()

Callers

nothing calls this directly

Calls 3

pformatMethod · 0.80
fromkeysMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected