diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-09-06 16:11:13 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-09-06 16:11:13 +0200 |
commit | 2b9b364f3130bd240c22939f2482a9f87b0c6b30 (patch) | |
tree | 7771208be7a530a1a6c52ce1f16305aa3ee5ddb6 | |
parent | b4503f620b731984efce8c97086868c21431d807 (diff) | |
download | logilab-common-2b9b364f3130bd240c22939f2482a9f87b0c6b30.tar.gz |
hack to avoid crash if error during doctest
-rw-r--r-- | testlib.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -484,8 +484,8 @@ class TestCase(unittest.TestCase): def __init__(self, methodName='runTest'): super(TestCase, self).__init__(methodName) - # internal API changed in python2.5 - if sys.version_info >= (2, 5): + # internal API changed in python2.4 and needed by DocTestCase + if sys.version_info >= (2, 4): self.__exc_info = sys.exc_info self.__testMethodName = self._testMethodName else: @@ -1207,6 +1207,9 @@ class DocTest(TestCase): finder = DocTestFinder(skipped=self.skipped) if sys.version_info >= (2, 4): suite = doctest.DocTestSuite(self.module, test_finder=finder) + if sys.version_info >= (2, 5): + # XXX iirk + doctest.DocTestCase._TestCase__exc_info = sys.exc_info else: suite = doctest.DocTestSuite(self.module) except AttributeError: |