zopefoundation / zope.testing

Other
4 stars 13 forks source link

Doctest 2 to 3 #15

Closed janwijbrand closed 8 years ago

janwijbrand commented 8 years ago

Introduce optionflag EXCEPTION_2TO3 to normalize exception class names in traceback output. In Python 3 they are displayed as the full dotted name. In Python 2 they are displayed as "just" the class name. When running doctests in Python 3, the optionflag will not have any effect, however when running the same test in Python 2, the segments in the full dotted name leading up to the class name are stripped away from the "expected" string.

janwijbrand commented 8 years ago

@mgedmin thank you for the comment. We processed them. Perhaps you could have another look? TIA.

janwijbrand commented 8 years ago

We found out by actually using zope.testing "in the field" that being smart about detecting traceback ouput worked only in the tests of zope.testing. We found that doctest will preprocess the exception output. See commit message and comment in renormalizing.py.