From: Serhiy Storchaka Date: Sat, 16 May 2015 18:34:56 +0000 (+0300) Subject: Added tests for more builtin types. X-Git-Tag: v2.7.11rc1~302^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6c1c1e3e2b6f7b85379da7c1a0f3fc9d2a4ed09;p=thirdparty%2FPython%2Fcpython.git Added tests for more builtin types. --- diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 50493f6d1a8b..bed9a932274d 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -56,6 +56,7 @@ class QueryTestCase(unittest.TestCase): # Verify .isrecursive() and .isreadable() w/o recursion pp = pprint.PrettyPrinter() for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, uni("yaddayadda"), + bytearray(b"ghi"), True, False, None, self.a, self.b): # module-level convenience functions self.assertFalse(pprint.isrecursive(safe), @@ -125,21 +126,23 @@ class QueryTestCase(unittest.TestCase): # it sorted a dict display if and only if the display required # multiple lines. For that reason, dicts with more than one element # aren't tested here. - for simple in (0, 0L, 0+0j, 0.0, "", uni(""), + for simple in (0, 0L, 0+0j, 0.0, "", uni(""), bytearray(), (), tuple2(), tuple3(), [], list2(), list3(), set(), set2(), set3(), frozenset(), frozenset2(), frozenset3(), {}, dict2(), dict3(), self.assertTrue, pprint, - -6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6}, + -6, -6L, -6-6j, -1.5, "x", uni("x"), bytearray(b"x"), + (3,), [3], {3: 6}, (1,2), [3,4], {5: 6}, tuple2((1,2)), tuple3((1,2)), tuple3(range(100)), [3,4], list2([3,4]), list3([3,4]), list3(range(100)), set({7}), set2({7}), set3({7}), frozenset({8}), frozenset2({8}), frozenset3({8}), dict2({5: 6}), dict3({5: 6}), - range(10, -11, -1) + range(10, -11, -1), + True, False, None, ): native = repr(simple) self.assertEqual(pprint.pformat(simple), native)