trial test fix for Py2.7
authorStefan Behnel <scoder@users.berlios.de>
Sat, 13 Mar 2010 06:36:35 +0000 (07:36 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 13 Mar 2010 06:36:35 +0000 (07:36 +0100)
Cython/Tests/xmlrunner.py

index 5519fc73c7a81283af3b66c2aae6a35b65d24f44..e72b139fb90ad18cd7b26d99ac14bfe5a382470d 100644 (file)
@@ -155,12 +155,16 @@ class _XMLTestResult(_TextTestResult):
         "Write some information about the FAIL or ERROR to the stream."
         for test_info in errors:
             self.stream.writeln(self.separator1)
-            self.stream.writeln('%s [%.3fs]: %s' % \
-                (flavour, test_info.get_elapsed_time(), \
-                test_info.get_description()))
-            self.stream.writeln(self.separator2)
-            self.stream.writeln('%s' % test_info.get_error_info())
-    
+            if isinstance(test_info, _TestInfo):
+                self.stream.writeln('%s [%.3fs]: %s' % \
+                    (flavour, test_info.get_elapsed_time(), \
+                    test_info.get_description()))
+                self.stream.writeln(self.separator2)
+                self.stream.writeln('%s' % test_info.get_error_info())
+            else:
+                self.stream.writeln(str(test_info))
+                self.stream.writeln(self.separator2)
+
     def _get_info_by_testcase(self):
         """This method organizes test results by TestCase module. This
         information is used during the report generation, where a XML report