Skip to content
Snippets Groups Projects
Commit 43602c675b4f authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

tests: use pyflakes as a tool, not a python module

The usage of pyflakes as a Python module was introduced in e397c6d74652, to work
around issue between Python 2 and Python 3. This issues are long behind us now
and we can get beck to using pyflakes as a tool, giving us more flexibility
about how we install it.

The `hghave` requirements is modified to check that we have a tool available,
instead of a python module.
parent 73cf8b56c2f5
No related branches found
No related tags found
2 merge requests!1041Merge default into stable,!1018tests: use pyflakes as a tool, not a python module
Pipeline #90316 passed
......@@ -609,14 +609,7 @@
@check("pyflakes", "Pyflakes python linter")
def has_pyflakes():
try:
import pyflakes
pyflakes.__version__
except ImportError:
return False
else:
return True
return matchoutput("pyflakes --version", br"^\d+\.\d+\.\d+\b", True)
@check("pylint", "Pylint python linter")
......
......@@ -8,7 +8,7 @@
$ cat > test.py <<EOF
> print(undefinedname)
> EOF
$ "$PYTHON" -m pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py"
$ pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py"
test.py:1:* undefined name 'undefinedname' (glob)
$ cd "`dirname "$TESTDIR"`"
......@@ -18,7 +18,7 @@
> -X contrib/python-zstandard \
> -X mercurial/thirdparty \
> 2>/dev/null \
> | xargs "$PYTHON" -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
> | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
contrib/perf.py:*:* undefined name 'xrange' (glob) (?)
mercurial/pycompat.py:*:* 'codecs' imported but unused (glob)
mercurial/pycompat.py:*:* 'concurrent.futures' imported but unused (glob)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment