[PATCH 7 of 7] tests/filterpyflakes: use absolute_import

Gregory Szorc gregory.szorc at gmail.com
Mon Dec 7 00:52:14 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1449469329 28800
#      Sun Dec 06 22:22:09 2015 -0800
# Node ID 0abf81e9534a938cb9dffae7577f07fc4733d3b4
# Parent  199dd71e1d0fb5f4d5fde31901ac8f13c26b8f38
tests/filterpyflakes: use absolute_import

diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
--- a/tests/filterpyflakes.py
+++ b/tests/filterpyflakes.py
@@ -1,13 +1,16 @@
 #!/usr/bin/env python
 
 # Filter output by pyflakes to control which warnings we check
 
-import sys, re
+from __future__ import absolute_import
+
+import re
+import sys
 
 def makekey(typeandline):
     """
     for sorting lines by: msgtype, path/to/file, lineno, message
 
     typeandline is a sequence of a message type and the entire message line
     the message line format is path/to/file:line: message
 
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -138,17 +138,16 @@
   mercurial/scmposix.py not using absolute_import
   mercurial/scmutil.py not using absolute_import
   mercurial/scmwindows.py not using absolute_import
   mercurial/similar.py not using absolute_import
   mercurial/store.py not using absolute_import
   mercurial/util.py not using absolute_import
   mercurial/windows.py not using absolute_import
   setup.py not using absolute_import
-  tests/filterpyflakes.py not using absolute_import
   tests/filterpyflakes.py requires print_function
   tests/generate-working-copy-states.py not using absolute_import
   tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py not using absolute_import
   tests/get-with-headers.py requires print_function
   tests/heredoctest.py not using absolute_import
   tests/heredoctest.py requires print_function
   tests/hghave.py not using absolute_import
diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -2,11 +2,11 @@
 
   $ cd "`dirname "$TESTDIR"`"
 
 run pyflakes on all tracked files ending in .py or without a file ending
 (skipping binary file random-seed)
 
   $ hg locate 'set:**.py or grep("^!#.*python")' 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
-  tests/filterpyflakes.py:58: undefined name 'undefinedname'
+  tests/filterpyflakes.py:61: undefined name 'undefinedname'
   
 


More information about the Mercurial-devel mailing list