diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-12-03 20:26:05 +0000 |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-12-03 20:26:05 +0000 |
commit | 5ac4782ebdcb73d6f9f5ebe1a0bae520c514dc66 (patch) | |
tree | 82f07c6ee1d505f50ef0c78bdf4554567748a75a /Lib/test/test_pprint.py | |
parent | 39e990bf19d1cb59bc5ae0edc8c6a33c1b25ddc4 (diff) | |
download | cpython-5ac4782ebdcb73d6f9f5ebe1a0bae520c514dc66.tar.gz |
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r-- | Lib/test/test_pprint.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index d66b78ac7d..a61bb663e6 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -154,6 +154,12 @@ class QueryTestCase(unittest.TestCase): for type in [tuple, tuple2]: self.assertEqual(pprint.pformat(type(o)), exp) + # indent parameter + o = range(100) + exp = '[ %s]' % ',\n '.join(map(str, o)) + for type in [list, list2]: + self.assertEqual(pprint.pformat(type(o), indent=4), exp) + def test_subclassing(self): o = {'names with spaces': 'should be presented using repr()', 'others.should.not.be': 'like.this'} |