From 4c504a4ff28d9a0b516719fa9ea4fddfe5b6bf2e Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 24 Jan 2014 20:40:43 +0000 Subject: [PATCH] [Test] Simplify reported names of failing Cython tests --- test/python/runCythonTests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/python/runCythonTests.py b/test/python/runCythonTests.py index 3bf7d96bb..9770905a6 100644 --- a/test/python/runCythonTests.py +++ b/test/python/runCythonTests.py @@ -28,16 +28,21 @@ class TestResult(unittest.TextTestResult): unittest.TextTestResult.__init__(self, *args, **kwargs) self.outfile = open('python%d-results.txt' % sys.version_info[0], 'w') + def reformat(self, test_string): + name, cls = test_string.split() + cls = cls.replace('(cantera.test.', '').replace(')','') + return '%s.%s' % (cls, name) + def addSuccess(self, test): - self.outfile.write('PASS: %s\n' % test) + self.outfile.write('PASS: %s\n' % self.reformat(str(test))) unittest.TextTestResult.addSuccess(self, test) def addFailure(self, test, err): - self.outfile.write('FAIL: %s\n' % test) + self.outfile.write('FAIL: %s\n' % self.reformat(str(test))) unittest.TextTestResult.addFailure(self, test, err) def addError(self, test, err): - self.outfile.write('ERROR: %s\n' % test) + self.outfile.write('ERROR: %s\n' % self.reformat(str(test))) unittest.TextTestResult.addFailure(self, test, err)