filterpyflakes: allow reexporting pure symbols from cffi modules
authorYuya Nishihara <yuya@tcha.org>
Sun, 28 May 2017 17:36:01 +0900
changeset 32510 50eaccb8353f
parent 32509 a025ec43856c
child 32511 2e431fb98c6b
filterpyflakes: allow reexporting pure symbols from cffi modules cffi modules will do 'from ..pure.<module> import *'.
tests/filterpyflakes.py
tests/test-check-pyflakes.t
--- a/tests/filterpyflakes.py	Tue May 02 22:28:18 2017 +0900
+++ b/tests/filterpyflakes.py	Sun May 28 17:36:01 2017 +0900
@@ -13,6 +13,9 @@
     pats = [
         r"undefined name 'WindowsError'",
         r"redefinition of unused '[^']+' from line",
+        # for cffi, allow re-exports from pure.*
+        r"cffi/[^:]*:.*\bimport \*' used",
+        r"cffi/[^:]*:.*\*' imported but unused",
     ]
 
     keep = True
--- a/tests/test-check-pyflakes.t	Tue May 02 22:28:18 2017 +0900
+++ b/tests/test-check-pyflakes.t	Sun May 28 17:36:01 2017 +0900
@@ -10,5 +10,5 @@
   > -X mercurial/pycompat.py -X contrib/python-zstandard \
   > 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
-  tests/filterpyflakes.py:38: undefined name 'undefinedname'
+  tests/filterpyflakes.py:41: undefined name 'undefinedname'