# HG changeset patch # User timeless # Date 2016-05-05 23:17:19 # Node ID daff05dcd1845481ad5f2164190ca23e6c06d109 # Parent a3e5e1fb257c4e2ddfd44168b85b748d30230700 run-tests: handle json.dumps divergence In py2, json.dumps includes a trailing space after a comma at the end of lines. The py3 behavior which omits the trailing space is preferable, so we're going to strip it. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1836,7 +1836,8 @@ class TextTestRunner(unittest.TextTestRu tres = {'result': res} outcome[tc.name] = tres - jsonout = json.dumps(outcome, sort_keys=True, indent=4) + out = json.dumps(outcome, sort_keys=True, indent=4) + jsonout = '\n'.join([l.rstrip() for l in out.splitlines()]) fp.writelines(("testreport =", jsonout)) self._runner._checkhglib('Tested') diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -586,7 +586,7 @@ Missing skips or blacklisted skips don't testreport ={ "test-bogus.t": { "result": "skip" - }, + }, "test-failure.t": { "result": "skip" }