[Python-checkins] python/dist/src/Lib/test test_pprint.py, 1.12,
1.13
doerwalter at users.sourceforge.net
doerwalter at users.sourceforge.net
Wed Dec 3 15:26:07 EST 2003
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv14858/Lib/test
Modified Files:
test_pprint.py
Log Message:
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
Index: test_pprint.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pprint.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_pprint.py 3 Dec 2003 20:15:28 -0000 1.12
--- test_pprint.py 3 Dec 2003 20:26:05 -0000 1.13
***************
*** 155,158 ****
--- 155,164 ----
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()',
More information about the Python-checkins
mailing list