[PATCH 3 of 3 V2] test-pyflakes: detect undefined name error

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu May 8 11:25:58 CDT 2014


At Fri, 02 May 2014 19:14:37 +0900,
Yuya Nishihara wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1398743641 -32400
> #      Tue Apr 29 12:54:01 2014 +0900
> # Node ID b7b37547eec4246671f7ae28843a6931813b810d
> # Parent  de513875f008f333f320aca0b236b6e8af54cdbf
> test-pyflakes: detect undefined name error
> 
> It should be able to catch the following mistakes at 2606e7f227f6:
> 
>     mercurial/exchange.py:590: undefined name 'UnknownPartError'
>     mercurial/match.py:346: undefined name 'pat'
>     mercurial/win32.py:365: undefined name '_ERROR_NO_MORE_FILES'
>     tests/killdaemons.py:46: undefined name 'check'
> 
> diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
> --- a/tests/filterpyflakes.py
> +++ b/tests/filterpyflakes.py
> @@ -32,6 +32,7 @@ for line in sys.stdin:
>              r"imported but unused",
>              r"local variable '.*' is assigned to but never used",
>              r"unable to detect undefined names",
> +            r"undefined name '.*'",
>             ]
>      for msgtype, pat in enumerate(pats):
>          if re.search(pat, line):

According to my bisect-ing, this change (0768cda8b579 in master repo)
seems to break "test-check-pyflakes.t" as below:

    ====================
    @@ -17,5 +17,7 @@
       tests/hghave.py:*: 'pygments' imported but unused (glob)
       tests/hghave.py:*: 'ssl' imported but unused (glob)
       contrib/win32/hgwebdir_wsgi.py:93: 'from isapi.install import *' used; unable to detect undefined names (glob)
    +  mercurial/util.py:116: undefined name 'memoryview'
    +  mercurial/windows.py:34: undefined name 'WindowsError'
    
     #endif
    ====================

Is this failure specific to my environment (python 2.6.6 on debian
2.6.32), or just expected failure ?

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list