##// END OF EJS Templates
run-tests: refactor json entry creation logic...
Pierre-Yves David -
r24981:012b79d5 default
parent child Browse files
Show More
@@ -1535,26 +1535,16 b' class TextTestRunner(unittest.TextTestRu'
1535 timesd[test] = (real, cuser, csys)
1535 timesd[test] = (real, cuser, csys)
1536
1536
1537 outcome = {}
1537 outcome = {}
1538 for tc in result.successes:
1538 groups = [('success', ((tc, None) for tc in result.successes)),
1539 testresult = {'result': 'success',
1539 ('failure', result.failures),
1540 'time': ('%0.3f' % timesd[tc.name][0]),
1540 ('skip', result.skipped)]
1541 'cuser': ('%0.3f' % timesd[tc.name][1]),
1541 for res, testcases in groups:
1542 'csys': ('%0.3f' % timesd[tc.name][2])}
1542 for tc, __ in testcases:
1543 outcome[tc.name] = testresult
1543 testresult = {'result': res,
1544
1544 'time': ('%0.3f' % timesd[tc.name][0]),
1545 for tc, error in result.failures:
1545 'cuser': ('%0.3f' % timesd[tc.name][1]),
1546 testresult = {'result': 'failure',
1546 'csys': ('%0.3f' % timesd[tc.name][2])}
1547 'time': ('%0.3f' % timesd[tc.name][0]),
1547 outcome[tc.name] = testresult
1548 'cuser': ('%0.3f' % timesd[tc.name][1]),
1549 'csys': ('%0.3f' % timesd[tc.name][2])}
1550 outcome[tc.name] = testresult
1551
1552 for tc, reason in result.skipped:
1553 testresult = {'result': 'skip',
1554 'time': ('%0.3f' % timesd[tc.name][0]),
1555 'cuser': ('%0.3f' % timesd[tc.name][1]),
1556 'csys': ('%0.3f' % timesd[tc.name][2])}
1557 outcome[tc.name] = testresult
1558
1548
1559 jsonout = json.dumps(outcome, sort_keys=True, indent=4)
1549 jsonout = json.dumps(outcome, sort_keys=True, indent=4)
1560 fp.writelines(("testreport =", jsonout))
1550 fp.writelines(("testreport =", jsonout))
General Comments 0
You need to be logged in to leave comments. Login now