[Zope-dev] Zope Tests: 10 OK, 4 Failed, 2 Unknown
Zvezdan Petkovic
zvezdan at zope.com
Tue May 4 11:44:08 EDT 2010
On May 4, 2010, at 6:07 AM, Martijn Faassen wrote:
> For a while already people have been making changes that at least break tests on 2.4. For instance, zope.testing has some facility to pretty print a dictionary that sorts the keys, because Python 2.4's built-in pretty print module apparently doesn't do that yet,
The pprint version in Python 2.4 sorts dictionaries too, but only if they don't fit on a single line of output.
> meaning random test failures can happen. But people have been updating code to use Python's built-in pretty print facility and this will only be reliable on Python 2.5 and higher.
I already corrected one such checkin with a simple workaround.
>>> pprint(somedict, width=1)
This causes Python 2.4 to pretty print somedict one item per line, and thus forces it to sort it.
So the tests using pprint can be made reliable on Python 2.4 to 2.6.
Zvezdan
More information about the Zope-Dev
mailing list