[Reviewers] [Differential] [Closed] D18: filterpyflakes: move self-test into test file

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jul 12 20:21:24 UTC 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6029939f7e98: filterpyflakes: move self-test into test file (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D18?vs=34&id=89

REVISION DETAIL
  https://phab.mercurial-scm.org/D18

AFFECTED FILES
  tests/filterpyflakes.py
  tests/test-check-pyflakes.t

CHANGE DETAILS

Index: tests/test-check-pyflakes.t
===================================================================
--- tests/test-check-pyflakes.t
+++ tests/test-check-pyflakes.t
@@ -6,10 +6,16 @@
 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'
+  
+
   $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
   > -X hgext/fsmonitor/pywatchman \
   > -X mercurial/pycompat.py -X contrib/python-zstandard \
   > 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
-  tests/filterpyflakes.py:41: undefined name 'undefinedname'
   
Index: tests/filterpyflakes.py
===================================================================
--- tests/filterpyflakes.py
+++ tests/filterpyflakes.py
@@ -35,7 +35,3 @@
 for line in lines:
     sys.stdout.write(line)
 print()
-
-# self test of "undefined name" detection
-if False:
-    print(undefinedname)


EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: durin42, krbullock
Cc: reviewers


More information about the Reviewers mailing list