equal
deleted
inserted
replaced
1714 |
1714 |
1715 if self._runner.options.json: |
1715 if self._runner.options.json: |
1716 if json is None: |
1716 if json is None: |
1717 raise ImportError("json module not installed") |
1717 raise ImportError("json module not installed") |
1718 jsonpath = os.path.join(self._runner._testdir, 'report.json') |
1718 jsonpath = os.path.join(self._runner._testdir, 'report.json') |
1719 fp = open(jsonpath, 'w') |
1719 with open(jsonpath, 'w') as fp: |
1720 try: |
|
1721 timesd = {} |
1720 timesd = {} |
1722 for tdata in result.times: |
1721 for tdata in result.times: |
1723 test = tdata[0] |
1722 test = tdata[0] |
1724 timesd[test] = tdata[1:] |
1723 timesd[test] = tdata[1:] |
1725 |
1724 |
1739 'diff': result.faildata.get(tc.name, ''), |
1738 'diff': result.faildata.get(tc.name, ''), |
1740 } |
1739 } |
1741 outcome[tc.name] = tres |
1740 outcome[tc.name] = tres |
1742 jsonout = json.dumps(outcome, sort_keys=True, indent=4) |
1741 jsonout = json.dumps(outcome, sort_keys=True, indent=4) |
1743 fp.writelines(("testreport =", jsonout)) |
1742 fp.writelines(("testreport =", jsonout)) |
1744 finally: |
|
1745 fp.close() |
|
1746 |
1743 |
1747 self._runner._checkhglib('Tested') |
1744 self._runner._checkhglib('Tested') |
1748 |
1745 |
1749 savetimes(self._runner._testdir, result) |
1746 savetimes(self._runner._testdir, result) |
1750 self.stream.writeln( |
1747 self.stream.writeln( |