~pythonregexp2.7/python/issue2636-11

« back to all changes in this revision

Viewing changes to Lib/test/test_pprint.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-21 17:53:26 UTC
  • mfrom: (39025.1.14 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080921175326-92vaej2hc3yuecxb
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
        for type in [list, list2]:
171
171
            self.assertEqual(pprint.pformat(type(o), indent=4), exp)
172
172
 
 
173
    def test_nested_indentations(self):
 
174
        o1 = list(range(10))
 
175
        o2 = dict(first=1, second=2, third=3)
 
176
        o = [o1, o2]
 
177
        expected = """\
 
178
[   [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
 
179
    {   'first': 1,
 
180
        'second': 2,
 
181
        'third': 3}]"""
 
182
        self.assertEqual(pprint.pformat(o, indent=4, width=42), expected)
 
183
 
173
184
    def test_sorted_dict(self):
174
185
        # Starting in Python 2.5, pprint sorts dict displays by key regardless
175
186
        # of how small the dictionary may be.