changeset 29199:daff05dcd184

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.
author timeless <timeless@mozdev.org>
date Thu, 05 May 2016 23:17:19 +0000
parents a3e5e1fb257c
children ca4065028e00
files tests/run-tests.py tests/test-run-tests.t
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue May 10 22:52:26 2016 +0000
+++ b/tests/run-tests.py	Thu May 05 23:17:19 2016 +0000
@@ -1836,7 +1836,8 @@
                                 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')
--- a/tests/test-run-tests.t	Tue May 10 22:52:26 2016 +0000
+++ b/tests/test-run-tests.t	Thu May 05 23:17:19 2016 +0000
@@ -586,7 +586,7 @@
   testreport ={
       "test-bogus.t": {
           "result": "skip"
-      }, 
+      },
       "test-failure.t": {
           "result": "skip"
       }