mailr14803 - /1.3/test_suite/relax_test_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 06, 2011 - 10:06:
Author: bugman
Date: Thu Oct  6 10:06:48 2011
New Revision: 14803

URL: http://svn.gna.org/viewcvs/relax?rev=14803&view=rev
Log:
Bug fix for the test suite for Python 2.6 and below, introduced at r14788.

The unittest.TextTestResult class only exists in Python 2.7 and above!


Modified:
    1.3/test_suite/relax_test_runner.py

Modified: 1.3/test_suite/relax_test_runner.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/relax_test_runner.py?rev=14803&r1=14802&r2=14803&view=diff
==============================================================================
--- 1.3/test_suite/relax_test_runner.py (original)
+++ 1.3/test_suite/relax_test_runner.py Thu Oct  6 10:06:48 2011
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2008 Edward d'Auvergne                                       
 #
+# Copyright (C) 2008-2011 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -21,13 +21,17 @@
 
###############################################################################
 
 # Python module imports.
-import sys
-from unittest import TextTestResult, TextTestRunner
-import wx
 try:
     from cStringIO import StringIO
 except ImportError:
     from StringIO import StringIO
+import sys
+try:
+    from unittest import TextTestResult    # Python 2.7 and above.
+except ImportError:
+    from unittest import _TextTestResult as TextTestResult    # Python 2.6 
and below.
+from unittest import TextTestRunner
+import wx
 
 # relax module imports.
 from status import Status; status = Status()




Related Messages


Powered by MHonArc, Updated Thu Oct 06 10:40:01 2011