Patchwork [7,of,7] tests/filterpyflakes: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 7, 2015, 6:52 a.m.
Message ID <0abf81e9534a938cb9df.1449471134@ubuntu-main>
Download mbox | patch
Permalink /patch/11898/
State Accepted
Headers show

Comments

Gregory Szorc - Dec. 7, 2015, 6:52 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1449469329 28800
#      Sun Dec 06 22:22:09 2015 -0800
# Node ID 0abf81e9534a938cb9dffae7577f07fc4733d3b4
# Parent  199dd71e1d0fb5f4d5fde31901ac8f13c26b8f38
tests/filterpyflakes: use absolute_import
Augie Fackler - Dec. 7, 2015, 10:45 p.m.
On Sun, Dec 06, 2015 at 10:52:14PM -0800, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1449469329 28800
> #      Sun Dec 06 22:22:09 2015 -0800
> # Node ID 0abf81e9534a938cb9dffae7577f07fc4733d3b4
> # Parent  199dd71e1d0fb5f4d5fde31901ac8f13c26b8f38
> tests/filterpyflakes: use absolute_import

These are queued, thanks!

>
> 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'
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

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'