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

Method test_nested_indentations

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

Source from the content-addressed store, hash-verified

319 self.assertEqual(pprint.pformat(type(o), indent=4), exp)
320
321 def test_nested_indentations(self):
322 o1 = list(range(10))
323 o2 = dict(first=1, second=2, third=3)
324 o = [o1, o2]
325 expected = """\
326[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
327 {'first': 1, 'second': 2, 'third': 3}]"""
328 self.assertEqual(pprint.pformat(o, indent=4, width=42), expected)
329 expected = """\
330[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
331 { 'first': 1,
332 'second': 2,
333 'third': 3}]"""
334 self.assertEqual(pprint.pformat(o, indent=4, width=41), expected)
335
336 def test_width(self):
337 expected = """\

Callers

nothing calls this directly

Calls 3

listClass · 0.85
pformatMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected