(self)
| 871 | self.assertEqual(pprint.pformat(o, width=47, compact=True), expected) |
| 872 | |
| 873 | def test_compact_width(self): |
| 874 | levels = 20 |
| 875 | number = 10 |
| 876 | o = [0] * number |
| 877 | for i in range(levels - 1): |
| 878 | o = [o] |
| 879 | for w in range(levels * 2 + 1, levels + 3 * number - 1): |
| 880 | lines = pprint.pformat(o, width=w, compact=True).splitlines() |
| 881 | maxwidth = max(map(len, lines)) |
| 882 | self.assertLessEqual(maxwidth, w) |
| 883 | self.assertGreater(maxwidth, w - 3) |
| 884 | |
| 885 | def test_bytes_wrap(self): |
| 886 | self.assertEqual(pprint.pformat(b'', width=1), "b''") |
nothing calls this directly
no test coverage detected