[PATCH 3 of 6] tests: add pyflakes checking for assigned to but never used

timeless timeless at gmail.com
Sun May 1 14:16:35 CDT 2011


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1304263661 -7200
# Node ID 11b2e498bd0f79755b71648261e17f9ce5a0214d
# Parent  52692bd2c323af04f95cabf0e8dbc5a23d42eca9
tests: add pyflakes checking for assigned to but never used

diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
--- a/tests/filterpyflakes.py
+++ b/tests/filterpyflakes.py
@@ -18,7 +18,11 @@ def makekey(message):
 lines = []
 for line in sys.stdin:
     # We whitelist tests
-    if not re.search("imported but unused", line):
+    pats = [
+            r"imported but unused",
+            r"local variable '.*' is assigned to but never used",
+           ]
+    if not re.search('|'.join(pats), line):
         continue
     lines.append(line)
 


More information about the Mercurial-devel mailing list