tests/test-check-pyflakes.t
author Adam Simpkins <simpkins@fb.com>
Tue, 27 Jun 2017 17:24:31 -0700
changeset 33116 6c113a7dec52
parent 32510 50eaccb8353f
child 33204 ddd65b4f3ae6
permissions -rw-r--r--
tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29138
a29f071751df tests: mark test-check-pyflakes.t as requiring hg1.0+
timeless <timeless@mozdev.org>
parents: 27285
diff changeset
     1
#require test-repo pyflakes hg10
21208
0e1cbd3d52f7 tests: add repository check for pyflakes test
Matt Mackall <mpm@selenic.com>
parents: 20644
diff changeset
     2
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29138
diff changeset
     3
  $ . "$TESTDIR/helpers-testrepo.sh"
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15372
diff changeset
     4
  $ cd "`dirname "$TESTDIR"`"
19377
0cb996ee8c6d tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents: 16350
diff changeset
     5
0cb996ee8c6d tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents: 16350
diff changeset
     6
run pyflakes on all tracked files ending in .py or without a file ending
0cb996ee8c6d tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents: 16350
diff changeset
     7
(skipping binary file random-seed)
21208
0e1cbd3d52f7 tests: add repository check for pyflakes test
Matt Mackall <mpm@selenic.com>
parents: 20644
diff changeset
     8
33116
6c113a7dec52 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents: 32510
diff changeset
     9
  $ syshg locate 'set:**.py or grep("^#!.*python")' \
6c113a7dec52 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents: 32510
diff changeset
    10
  > -X hgext/fsmonitor/pywatchman \
30894
5b60464efbde tests: exclude python-zstandard from pyflakes analysis
Augie Fackler <augie@google.com>
parents: 30655
diff changeset
    11
  > -X mercurial/pycompat.py -X contrib/python-zstandard \
29584
06587edd1233 pycompat: make pycompat demandimport friendly
Pulkit Goyal <7895pulkit@gmail.com>
parents: 29232
diff changeset
    12
  > 2>/dev/null \
19377
0cb996ee8c6d tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents: 16350
diff changeset
    13
  > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
32510
50eaccb8353f filterpyflakes: allow reexporting pure symbols from cffi modules
Yuya Nishihara <yuya@tcha.org>
parents: 32277
diff changeset
    14
  tests/filterpyflakes.py:41: undefined name 'undefinedname'
22053
4354b1e35f53 tests: fix pyflakes test whitespace breakage
Matt Mackall <mpm@selenic.com>
parents: 22047
diff changeset
    15