[PATCH] test: remove dependency on $PYTHONDIR

Durham Goode durham at fb.com
Thu Feb 18 01:07:14 EST 2016


On 2/17/16 7:05 PM, timeless wrote:
> Durham Goode <durham at fb.com> wrote:
>> If we want to reduce the chance of needing to change globs in this test
>> case, we could grep away most of the output, and only verify that a basic
>> stack trace was produced (like only look for dispatch.run).
> I want something that works for this too:
> -  devel-warn: revset "oldstyle" use list instead of smartset,
> (upgrade your code) at: $PYTHONDIR/mercurial/revset.py:* (mfunc)
> (glob)
>
> The regexp to reform PYTHONDIR worked pretty nicely.
I understand the frustration with fixing glob'd lines, but won't these 
lines need manual fixing even with the $PYTHONDIR change? Because the 
line number is glob'd?

Perhaps, instead of hard coding $PYTHONDIR in the tests, you could 
post-process the -i output, and replace any occurrence of the python 
directory path with a glob and add (glob) at the end of the line. That 
way -i works correctly for anyone with a standard python path set up, 
and we're not hard coding expected python paths in the tests.  From 
looking at the code in run-tests.py:addOutputMismatch(), it might be as 
simple as a regex.replace().

Such post processing logic could also eventually recognize 
"file.py:LINE" patterns and auto-glob the LINE as well.


More information about the Mercurial-devel mailing list