tests/test-check-pyflakes.t
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 21 Mar 2018 18:13:40 -0700
changeset 37181 49630e75635d
parent 37130 0e06d8086295
child 37184 559069689121
permissions -rw-r--r--
thirdparty: allow zope.interface.advice to be lazily imported The symbol from this module is only used in functions. Let's access that symbol through its imported module so importing zope.interface.advice can be lazy. Differential Revision: https://phab.mercurial-scm.org/D2931

#require test-repo pyflakes hg10

  $ . "$TESTDIR/helpers-testrepo.sh"

run pyflakes on all tracked files ending in .py or without a file ending
(skipping binary file random-seed)

  $ cat > test.py <<EOF
  > print(undefinedname)
  > EOF
  $ pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py"
  test.py:1: undefined name 'undefinedname'
  
  $ cd "`dirname "$TESTDIR"`"

  $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
  > -X hgext/fsmonitor/pywatchman \
  > -X mercurial/pycompat.py -X contrib/python-zstandard \
  > -X mercurial/thirdparty/cbor \
  > 2>/dev/null \
  > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"