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

Method test_sort_dict

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

Source from the content-addressed store, hash-verified

402 r"{5: [[]], 'xy\tab\n': (3,), (): {}}")
403
404 def test_sort_dict(self):
405 d = dict.fromkeys('cba')
406 self.assertEqual(pprint.pformat(d, sort_dicts=False), "{'c': None, 'b': None, 'a': None}")
407 self.assertEqual(pprint.pformat([d, d], sort_dicts=False),
408 "[{'c': None, 'b': None, 'a': None}, {'c': None, 'b': None, 'a': None}]")
409
410 def test_ordered_dict(self):
411 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