##// END OF EJS Templates
run-tests: fix crash when --json and --blacklist are both used (issue5050)...
Laurent Charignon -
r27927:0de4dfc9 stable
parent child Browse files
Show More
@@ -1727,14 +1727,20 b' class TextTestRunner(unittest.TextTestRu'
1727 1727 ('skip', result.skipped)]
1728 1728 for res, testcases in groups:
1729 1729 for tc, __ in testcases:
1730 if tc.name in timesd:
1730 1731 tres = {'result': res,
1731 1732 'time': ('%0.3f' % timesd[tc.name][2]),
1732 1733 'cuser': ('%0.3f' % timesd[tc.name][0]),
1733 1734 'csys': ('%0.3f' % timesd[tc.name][1]),
1734 1735 'start': ('%0.3f' % timesd[tc.name][3]),
1735 1736 'end': ('%0.3f' % timesd[tc.name][4]),
1736 'diff': result.faildata.get(tc.name, ''),
1737 'diff': result.faildata.get(tc.name,
1738 ''),
1737 1739 }
1740 else:
1741 # blacklisted test
1742 tres = {'result': res}
1743
1738 1744 outcome[tc.name] = tres
1739 1745 jsonout = json.dumps(outcome, sort_keys=True, indent=4)
1740 1746 fp.writelines(("testreport =", jsonout))
@@ -494,13 +494,21 b' Skips with xml'
494 494
495 495 Missing skips or blacklisted skips don't count as executed:
496 496 $ echo test-failure.t > blacklist
497 $ rt --blacklist=blacklist \
497 $ rt --blacklist=blacklist --json\
498 498 > test-failure.t test-bogus.t
499 499 ss
500 500 Skipped test-bogus.t: Doesn't exist
501 501 Skipped test-failure.t: blacklisted
502 502 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
503
503 $ cat report.json
504 testreport ={
505 "test-bogus.t": {
506 "result": "skip"
507 },
508 "test-failure.t": {
509 "result": "skip"
510 }
511 } (no-eol)
504 512 #if json
505 513
506 514 test for --json
General Comments 0
You need to be logged in to leave comments. Login now