File: test-check-pyflakes.t

package info (click to toggle)
hg-git 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,244 kB
  • sloc: python: 8,702; sh: 185; makefile: 23
file content (19 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#require test-repo pyflakes hg10

Load commonly used test logic
  $ . "$TESTDIR/testutil"
  $ . "$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
  $ "$PYTHON" -m pyflakes test.py 2>/dev/null
  test.py:1:* undefined name 'undefinedname' (glob)
  [1]
  $ cd "`dirname "$TESTDIR"`"

  $ testrepohg files -I 'relglob:*.py' -I 'grep("^#!.*python*")' -X tests \
  > | xargs $PYTHON -m pyflakes 2>/dev/null