From: Stefan Behnel Date: Sat, 6 Mar 2010 07:04:50 +0000 (+0100) Subject: fix test crashes X-Git-Tag: 0.13.beta0~2^2~100^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eba0c000bce3d89747f4257540a8c6c353e6e680;p=cython.git fix test crashes --- diff --git a/Cython/Tests/xmlrunner.py b/Cython/Tests/xmlrunner.py index 3dfedc13..3b6e6ddf 100644 --- a/Cython/Tests/xmlrunner.py +++ b/Cython/Tests/xmlrunner.py @@ -186,7 +186,7 @@ class _XMLTestResult(_TextTestResult): testsuite = xml_document.createElement('testsuite') xml_document.appendChild(testsuite) - testsuite.setAttribute('name', suite_name) + testsuite.setAttribute('name', str(suite_name)) testsuite.setAttribute('tests', str(len(tests))) testsuite.setAttribute('time', '%.3f' % \ @@ -207,8 +207,8 @@ class _XMLTestResult(_TextTestResult): testcase = xml_document.createElement('testcase') xml_testsuite.appendChild(testcase) - testcase.setAttribute('classname', suite_name) - testcase.setAttribute('name', test_result.test_method.shortDescription() or test_result.test_method._testMethodName) + testcase.setAttribute('classname', str(suite_name)) + testcase.setAttribute('name', str(test_result.test_method.shortDescription() or test_result.test_method._testMethodName)) testcase.setAttribute('time', '%.3f' % test_result.get_elapsed_time()) if (test_result.outcome != _TestInfo.SUCCESS): @@ -216,8 +216,8 @@ class _XMLTestResult(_TextTestResult): failure = xml_document.createElement(elem_name) testcase.appendChild(failure) - failure.setAttribute('type', test_result.err[0].__name__) - failure.setAttribute('message', test_result.err[1].message) + failure.setAttribute('type', str(test_result.err[0].__name__)) + failure.setAttribute('message', str(test_result.err[1].message)) error_info = test_result.get_error_info() failureText = xml_document.createCDATASection(error_info)