[PATCH 003 of 179 tests-refactor] run-tests: move replacements generation into Test

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 7 15:38:59 CDT 2014



On 05/02/2014 11:37 AM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1397937804 25200
> #      Sat Apr 19 13:03:24 2014 -0700
> # Branch stable
> # Node ID b5da54671ef0204c48ce54715aa547cb1766fb7d
> # Parent  b81c28c2cb25a35e899faf379b3f139dc12cbd66
> run-tests: move replacements generation into Test
>
> The API is a bit funky. Things will look better once all state is
> captured in Test.
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -588,16 +588,34 @@ class Test(object):
>           os.mkdir(self.testtmp)
>
>       def run(self, replacements, env):
>           return self._run(replacements, env)
>
>       def _run(self, replacements, env):
>           raise NotImplemented('Subclasses must implement Test.run()')
>
> +    def getreplacements(self, count):

Now that you injected some understanding of what this step is. We need 
to extract it for future people looking at this code (including you 
future self).

In other word: this methods needs a docstring.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list