Py2.3 test work-around
authorStefan Behnel <scoder@users.berlios.de>
Thu, 11 Mar 2010 09:07:21 +0000 (10:07 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 11 Mar 2010 09:07:21 +0000 (10:07 +0100)
Cython/Tests/xmlrunner.py

index 3b6e6ddfe76a68e956068f3d6bb63a81b8567026..a2054fc1f1bae06433d61a6b36bb7e3a2216205c 100644 (file)
@@ -208,7 +208,9 @@ class _XMLTestResult(_TextTestResult):
         xml_testsuite.appendChild(testcase)
         
         testcase.setAttribute('classname', str(suite_name))
-        testcase.setAttribute('name', str(test_result.test_method.shortDescription() or test_result.test_method._testMethodName))
+        testcase.setAttribute('name', test_result.test_method.shortDescription()
+                              or getattr(test_result.test_method, '_testMethodName',
+                                         str(test_result.test_method)))
         testcase.setAttribute('time', '%.3f' % test_result.get_elapsed_time())
         
         if (test_result.outcome != _TestInfo.SUCCESS):