Patchwork run-tests: use json.dumps(separators=)

login
register
mail settings
Submitter timeless
Date May 26, 2016, 4:36 a.m.
Message ID <b9b9babe6066a7682ae6.1464237372@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15218/
State Accepted
Headers show

Comments

timeless - May 26, 2016, 4:36 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1464230144 0
#      Thu May 26 02:35:44 2016 +0000
# Node ID b9b9babe6066a7682ae6ed7832aab713f30d38e0
# Parent  fd288d118074ea8d7b4ddec10da6e75a71ba3312
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r b9b9babe6066
run-tests: use json.dumps(separators=)

Followup to daff05dcd184 per Martijn Pieters
Martijn Pieters - May 26, 2016, 4:41 a.m.
On 25 May 2016 at 21:36, timeless <timeless@fmr.im> wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1464230144 0
> #      Thu May 26 02:35:44 2016 +0000
> # Node ID b9b9babe6066a7682ae6ed7832aab713f30d38e0
> # Parent  fd288d118074ea8d7b4ddec10da6e75a71ba3312
> # Available At https://bitbucket.org/timeless/mercurial-crew
> #              hg pull https://bitbucket.org/timeless/mercurial-crew -r b9b9babe6066
> run-tests: use json.dumps(separators=)
>
> Followup to daff05dcd184 per Martijn Pieters
>
> diff -r fd288d118074 -r b9b9babe6066 tests/run-tests.py
> --- a/tests/run-tests.py        Mon May 09 10:05:32 2016 +0200
> +++ b/tests/run-tests.py        Thu May 26 02:35:44 2016 +0000
> @@ -1836,8 +1836,8 @@
>                                  tres = {'result': res}
>
>                              outcome[tc.name] = tres
> -                    out = json.dumps(outcome, sort_keys=True, indent=4)
> -                    jsonout = '\n'.join([l.rstrip() for l in out.splitlines()])
> +                    jsonout = json.dumps(outcome, sort_keys=True, indent=4,
> +                                         separators=(',', ': '))
>                      fp.writelines(("testreport =", jsonout))
>
>              self._runner._checkhglib('Tested')
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Thanks for doing this! +1 from me.
Yuya Nishihara - May 26, 2016, 1:22 p.m.
On Thu, 26 May 2016 04:36:12 +0000, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1464230144 0
> #      Thu May 26 02:35:44 2016 +0000
> # Node ID b9b9babe6066a7682ae6ed7832aab713f30d38e0
> # Parent  fd288d118074ea8d7b4ddec10da6e75a71ba3312
> # Available At https://bitbucket.org/timeless/mercurial-crew
> #              hg pull https://bitbucket.org/timeless/mercurial-crew -r b9b9babe6066
> run-tests: use json.dumps(separators=)

Sure, pushing to the committed repo, thanks!

Patch

diff -r fd288d118074 -r b9b9babe6066 tests/run-tests.py
--- a/tests/run-tests.py	Mon May 09 10:05:32 2016 +0200
+++ b/tests/run-tests.py	Thu May 26 02:35:44 2016 +0000
@@ -1836,8 +1836,8 @@ 
                                 tres = {'result': res}
 
                             outcome[tc.name] = tres
-                    out = json.dumps(outcome, sort_keys=True, indent=4)
-                    jsonout = '\n'.join([l.rstrip() for l in out.splitlines()])
+                    jsonout = json.dumps(outcome, sort_keys=True, indent=4,
+                                         separators=(',', ': '))
                     fp.writelines(("testreport =", jsonout))
 
             self._runner._checkhglib('Tested')