test-pyflakes: detect undefined name error

It should be able to catch the following mistakes at 764c0874d3c8:

    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'
This commit is contained in:
Yuya Nishihara 2014-04-29 12:54:01 +09:00
parent 50920757c6
commit 2e43b76140

View File

@ -32,6 +32,7 @@ for line in sys.stdin:
r"imported but unused", r"imported but unused",
r"local variable '.*' is assigned to but never used", r"local variable '.*' is assigned to but never used",
r"unable to detect undefined names", r"unable to detect undefined names",
r"undefined name '.*'",
] ]
for msgtype, pat in enumerate(pats): for msgtype, pat in enumerate(pats):
if re.search(pat, line): if re.search(pat, line):