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

Method test_nested_indentations

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

Source from the content-addressed store, hash-verified

434 self.assertEqual(pprint.pformat(type(o), indent=4), exp)
435
436 def test_nested_indentations(self):
437 o1 = list(range(10))
438 o2 = dict(first=1, second=2, third=3)
439 o = [o1, o2]
440 expected = """\
441[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
442 {'first': 1, 'second': 2, 'third': 3}]"""
443 self.assertEqual(pprint.pformat(o, indent=4, width=42), expected)
444 expected = """\
445[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
446 { 'first': 1,
447 'second': 2,
448 'third': 3}]"""
449 self.assertEqual(pprint.pformat(o, indent=4, width=41), expected)
450
451 def test_width(self):
452 expected = """\

Callers

nothing calls this directly

Calls 3

listClass · 0.85
pformatMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected