From db48dbe11a7b2074ea5365cb8aac970319bd50a2 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 14 Oct 2009 15:57:48 -0300 Subject: [PATCH] fix for unittest changes in upcoming Py2.7 and Py3.2 --- runtests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index c19a2903..201f191f 100644 --- a/runtests.py +++ b/runtests.py @@ -427,9 +427,14 @@ class _FakeClass(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) -class PartialTestResult(unittest._TextTestResult): +try: # Py2.7+ and Py3.2+ + from unittest.runner import _TextTestResult +except ImportError: + from unittest import _TextTestResult + +class PartialTestResult(_TextTestResult): def __init__(self, base_result): - unittest._TextTestResult.__init__( + _TextTestResult.__init__( self, self._StringIO(), True, base_result.dots + base_result.showAll*2) -- 2.26.2