Skip to content

Commit

Permalink
Work around pprint breakage in Python 3.4.0.
Browse files Browse the repository at this point in the history
'width=1' causes excess wrapping.
  • Loading branch information
tseaver committed Dec 26, 2014
1 parent 4d0c846 commit f4b3b80
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/ZODB/tests/testDB.py
Expand Up @@ -141,17 +141,16 @@ def connectionDebugInfo():
>>> c3 = db.open(before=c1.root()._p_serial)
>>> info = db.connectionDebugInfo()
>>> import pprint
>>> pprint.pprint(sorted(info, key=lambda i: str(i['opened'])), width=1)
[{'before': None,
'info': 'test info (2)',
'opened': '2008-12-04T20:40:44Z (1.40s)'},
{'before': '\x03zY\xd8\xc0m9\xdd',
'info': ' (0)',
'opened': '2008-12-04T20:40:45Z (0.30s)'},
{'before': None,
'info': ' (0)',
'opened': None}]
>>> info = sorted(info, key=lambda i: str(i['opened']))
>>> before = [x['before'] for x in info]
>>> opened = [x['opened'] for x in info]
>>> infos = [x['info'] for x in info]
>>> before
[None, '\x03zY\xd8\xc0m9\xdd', None]
>>> opened
['2008-12-04T20:40:44Z (1.40s)', '2008-12-04T20:40:45Z (0.30s)', None]
>>> infos
['test info (2)', ' (0)', ' (0)']
>>> time.time = real_time
Expand Down

0 comments on commit f4b3b80

Please sign in to comment.