(self)
| 487 | '2']]]]]""") |
| 488 | |
| 489 | def test_integer(self): |
| 490 | self.assertEqual(pprint.pformat(1234567), '1234567') |
| 491 | self.assertEqual(pprint.pformat(1234567, underscore_numbers=True), '1_234_567') |
| 492 | |
| 493 | class Temperature(int): |
| 494 | def __new__(cls, celsius_degrees): |
| 495 | return super().__new__(Temperature, celsius_degrees) |
| 496 | def __repr__(self): |
| 497 | kelvin_degrees = self + 273.15 |
| 498 | return f"{kelvin_degrees:.2f}°K" |
| 499 | self.assertEqual(pprint.pformat(Temperature(1000)), '1273.15°K') |
| 500 | |
| 501 | def test_sorted_dict(self): |
| 502 | # Starting in Python 2.5, pprint sorts dict displays by key regardless |
nothing calls this directly
no test coverage detected