tests: remove from __future__ from inline Python in tests
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Feb 2022 15:28:44 -0700
changeset 48876 42d2b31cee0b
parent 48875 6000f5b25c9b
child 48877 fcb34c099259
tests: remove from __future__ from inline Python in tests This is no longer required since we require Python 3 and the linter no longer requires these statements. Differential Revision: https://phab.mercurial-scm.org/D12255
tests/test-annotate.t
tests/test-arbitraryfilectx.t
tests/test-archive.t
tests/test-bisect.t
tests/test-blackbox.t
tests/test-bookmarks.t
tests/test-bugzilla.t
tests/test-bundle.t
tests/test-bundle2-pushback.t
tests/test-check-help.t
tests/test-chg.t
tests/test-commit-interactive.t
tests/test-commit.t
tests/test-context-metadata.t
tests/test-convert-clonebranches.t
tests/test-dirstate.t
tests/test-eol.t
tests/test-extension.t
tests/test-fastannotate-hg.t
tests/test-filebranch.t
tests/test-fncache.t
tests/test-hardlinks.t
tests/test-help.t
tests/test-hgweb-no-path-info.t
tests/test-hgweb-no-request-uri.t
tests/test-hgweb-non-interactive.t
tests/test-hook.t
tests/test-impexp-branch.t
tests/test-import.t
tests/test-imports-checker.t
tests/test-inherit-mode.t
tests/test-largefiles-cache.t
tests/test-largefiles-small-disk.t
tests/test-log-exthook.t
tests/test-log.t
tests/test-logtoprocess.t
tests/test-merge-symlinks.t
tests/test-merge1.t
tests/test-narrow-clone-non-narrow-server.t
tests/test-notify.t
tests/test-obsolete.t
tests/test-pager.t
tests/test-parseindex.t
tests/test-patch.t
tests/test-patchbomb.t
tests/test-profile.t
tests/test-progress.t
tests/test-rebase-dest.t
tests/test-rebase-scenario-global.t
tests/test-relink.t
tests/test-requires.t
tests/test-revert.t
tests/test-revlog-mmapindex.t
tests/test-revset.t
tests/test-share-bookmarks.t
tests/test-ssh-proto-unbundle.t
tests/test-strip.t
tests/test-template-functions.t
tests/test-template-map.t
tests/test-update-atomic.t
tests/test-verify.t
tests/test-walk.t
tests/test-worker.t
--- a/tests/test-annotate.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-annotate.t	Sun Feb 20 15:28:44 2022 -0700
@@ -478,7 +478,6 @@
 and its ancestor by overriding "repo._filecommit".
 
   $ cat > ../legacyrepo.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import commit, error, extensions
   > def _filecommit(orig, repo, fctx, manifest1, manifest2,
   >                 linkrev, tr, includecopymeta, ms):
--- a/tests/test-arbitraryfilectx.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-arbitraryfilectx.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,6 +1,5 @@
 Setup:
   $ cat > eval.py <<EOF
-  > from __future__ import absolute_import
   > import filecmp
   > from mercurial import commands, context, pycompat, registrar
   > cmdtable = {}
--- a/tests/test-archive.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-archive.t	Sun Feb 20 15:28:44 2022 -0700
@@ -320,7 +320,6 @@
   $ TIP=`hg id -v | cut -f1 -d' '`
   $ QTIP=`hg id -q`
   $ cat > getarchive.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > from mercurial import (
@@ -455,7 +454,6 @@
   > done
 
   $ cat > md5comp.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import hashlib
   > import sys
   > f1, f2 = sys.argv[1:3]
@@ -617,7 +615,6 @@
   $ hg -R repo add repo/a
   $ hg -R repo commit -m '#0' -d '456789012 21600'
   $ cat > show_mtime.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > print(int(os.stat(sys.argv[1]).st_mtime))
--- a/tests/test-bisect.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-bisect.t	Sun Feb 20 15:28:44 2022 -0700
@@ -462,7 +462,6 @@
 
   $ cat > script.py <<EOF
   > #!$PYTHON
-  > from __future__ import absolute_import
   > import sys
   > from mercurial import hg, ui as uimod
   > repo = hg.repository(uimod.ui.load(), b'.')
--- a/tests/test-blackbox.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-blackbox.t	Sun Feb 20 15:28:44 2022 -0700
@@ -403,7 +403,6 @@
 when using chg, blackbox.log should get rotated correctly
 
   $ cat > $TESTTMP/noop.py << EOF
-  > from __future__ import absolute_import
   > import time
   > from mercurial import registrar, scmutil
   > cmdtable = {}
@@ -463,7 +462,6 @@
 blackbox should work if repo.ui.log is not called (issue5518)
 
   $ cat > $TESTTMP/raise.py << EOF
-  > from __future__ import absolute_import
   > from mercurial import registrar, scmutil
   > cmdtable = {}
   > command = registrar.command(cmdtable)
--- a/tests/test-bookmarks.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-bookmarks.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1069,7 +1069,6 @@
   $ echo a > a
 
   $ cat > $TESTTMP/pausefinalize.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import time
   > from mercurial import extensions, localrepo
--- a/tests/test-bugzilla.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-bugzilla.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,7 +1,6 @@
 mock bugzilla driver for testing template output:
 
   $ cat <<EOF > bzmock.py
-  > from __future__ import absolute_import
   > from mercurial import extensions
   > from mercurial import pycompat
   > from mercurial import registrar
--- a/tests/test-bundle.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-bundle.t	Sun Feb 20 15:28:44 2022 -0700
@@ -466,7 +466,6 @@
 transaction)
 
   $ cat > $TESTTMP/showtip.py <<EOF
-  > from __future__ import absolute_import
   > 
   > def showtip(ui, repo, hooktype, **kwargs):
   >     ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
--- a/tests/test-bundle2-pushback.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-bundle2-pushback.t	Sun Feb 20 15:28:44 2022 -0700
@@ -3,7 +3,6 @@
   > Current bundle2 implementation doesn't provide a way to generate those
   > parts, so they must be created by extensions.
   > """
-  > from __future__ import absolute_import
   > from mercurial import bundle2, exchange, pushkey, util
   > def _newhandlechangegroup(op, inpart):
   >     """This function wraps the changegroup part handler for getbundle.
--- a/tests/test-check-help.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-check-help.t	Sun Feb 20 15:28:44 2022 -0700
@@ -3,7 +3,6 @@
   $ . "$TESTDIR/helpers-testrepo.sh"
 
   $ cat <<'EOF' > scanhelptopics.py
-  > from __future__ import absolute_import, print_function
   > import re
   > import sys
   > if sys.platform == "win32":
--- a/tests/test-chg.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-chg.t	Sun Feb 20 15:28:44 2022 -0700
@@ -132,7 +132,6 @@
   > EOF
 
   $ cat > $TESTTMP/fakepager.py <<EOF
-  > from __future__ import absolute_import
   > import sys
   > import time
   > for line in iter(sys.stdin.readline, ''):
--- a/tests/test-commit-interactive.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-commit-interactive.t	Sun Feb 20 15:28:44 2022 -0700
@@ -938,7 +938,6 @@
   $ export LANGUAGE
 
   $ cat > $TESTTMP/escape.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import (
   >     pycompat,
   > )
--- a/tests/test-commit.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-commit.t	Sun Feb 20 15:28:44 2022 -0700
@@ -645,7 +645,6 @@
   
 verify pathauditor blocks evil filepaths
   $ cat > evil-commit.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import context, hg, ui as uimod
   > notrc = u".h\u200cg".encode('utf-8') + b'/hgrc'
   > u = uimod.ui.load()
@@ -671,7 +670,6 @@
   $ hg rollback -f
   repository tip rolled back to revision 2 (undo commit)
   $ cat > evil-commit.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import context, hg, ui as uimod
   > notrc = b"HG~1/hgrc"
   > u = uimod.ui.load()
@@ -691,7 +689,6 @@
   $ hg rollback -f
   repository tip rolled back to revision 2 (undo commit)
   $ cat > evil-commit.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import context, hg, ui as uimod
   > notrc = b"HG8B6C~2/hgrc"
   > u = uimod.ui.load()
--- a/tests/test-context-metadata.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-context-metadata.t	Sun Feb 20 15:28:44 2022 -0700
@@ -12,7 +12,6 @@
   $ hg commit -m 'Remove A'
 
   $ cat > metaedit.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import context, pycompat, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
--- a/tests/test-convert-clonebranches.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-convert-clonebranches.t	Sun Feb 20 15:28:44 2022 -0700
@@ -31,7 +31,6 @@
 Miss perl... sometimes
 
   $ cat > filter.py <<EOF
-  > from __future__ import absolute_import
   > import re
   > import sys
   > 
--- a/tests/test-dirstate.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-dirstate.t	Sun Feb 20 15:28:44 2022 -0700
@@ -77,7 +77,6 @@
 coherent (issue4353)
 
   $ cat > ../dirstateexception.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import (
   >   error,
   >   extensions,
--- a/tests/test-eol.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-eol.t	Sun Feb 20 15:28:44 2022 -0700
@@ -8,7 +8,6 @@
 Set up helpers
 
   $ cat > switch-eol.py <<'EOF'
-  > from __future__ import absolute_import
   > import os
   > import sys
   > try:
--- a/tests/test-extension.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-extension.t	Sun Feb 20 15:28:44 2022 -0700
@@ -150,7 +150,6 @@
 Check that extensions are loaded in phases:
 
   $ cat > foo.py <<EOF
-  > from __future__ import print_function
   > import os
   > from mercurial import exthelper
   > from mercurial.utils import procutil
@@ -295,7 +294,6 @@
   $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
 
   $ cat > $TESTTMP/libroot/mod/ambigabs.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import, print_function
   > import ambig # should load "libroot/ambig.py"
   > s = ambig.s
   > NO_CHECK_EOF
@@ -311,7 +309,6 @@
 
 #if no-py3
   $ cat > $TESTTMP/libroot/mod/ambigrel.py <<NO_CHECK_EOF
-  > from __future__ import print_function
   > import ambig # should load "libroot/mod/ambig.py"
   > s = ambig.s
   > NO_CHECK_EOF
@@ -340,7 +337,6 @@
   > s = b'this is extroot.sub1.baz'
   > NO_CHECK_EOF
   $ cat > $TESTTMP/extroot/__init__.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > s = b'this is extroot.__init__'
   > from . import foo
   > def extsetup(ui):
@@ -453,7 +449,6 @@
   > detail = b"this is extlibroot.recursedown.abs.used"
   > NO_CHECK_EOF
   $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from extlibroot.recursedown.abs.used import detail
   > NO_CHECK_EOF
 
@@ -467,7 +462,6 @@
   > NO_CHECK_EOF
 
   $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from extlibroot.recursedown.abs import detail as absdetail
   > from .legacy import detail as legacydetail
   > NO_CHECK_EOF
@@ -481,11 +475,9 @@
   > detail = b"this is extlibroot.shadowing.used"
   > NO_CHECK_EOF
   $ cat > $TESTTMP/extlibroot/shadowing/proxied.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from extlibroot.shadowing.used import detail
   > NO_CHECK_EOF
   $ cat > $TESTTMP/extlibroot/shadowing/__init__.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from .used import detail as used
   > NO_CHECK_EOF
 
@@ -514,7 +506,6 @@
   > detail = b"this is absextroot.relimportee"
   > NO_CHECK_EOF
   $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from mercurial import pycompat
   > from ... import relimportee
   > detail = b"this relimporter imports %r" % (
@@ -525,7 +516,6 @@
 runtime.
 
   $ cat > $TESTTMP/absextroot/absolute.py << NO_CHECK_EOF
-  > from __future__ import absolute_import
   > 
   > # import extension local modules absolutely (level = 0)
   > from absextroot.xsub1.xsub2 import used, unused
@@ -539,7 +529,6 @@
   > NO_CHECK_EOF
 
   $ cat > $TESTTMP/absextroot/relative.py << NO_CHECK_EOF
-  > from __future__ import absolute_import
   > 
   > # import extension local modules relatively (level == 1)
   > from .xsub1.xsub2 import used, unused
@@ -559,7 +548,6 @@
 Setup main procedure of extension.
 
   $ cat > $TESTTMP/absextroot/__init__.py <<NO_CHECK_EOF
-  > from __future__ import absolute_import
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
@@ -1925,7 +1913,6 @@
   $ hg init $TESTTMP/opt-unicode-default
 
   $ cat > $TESTTMP/test_unicode_default_value.py << EOF
-  > from __future__ import print_function
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
--- a/tests/test-fastannotate-hg.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-fastannotate-hg.t	Sun Feb 20 15:28:44 2022 -0700
@@ -481,7 +481,6 @@
 and its ancestor by overriding "repo._filecommit".
 
   $ cat > ../legacyrepo.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import commit, error, extensions
   > def _filecommit(orig, repo, fctx, manifest1, manifest2,
   >                 linkrev, tr, includecopymeta, ms):
--- a/tests/test-filebranch.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-filebranch.t	Sun Feb 20 15:28:44 2022 -0700
@@ -2,7 +2,6 @@
 when we do a merge.
 
   $ cat <<EOF > merge
-  > from __future__ import print_function
   > import sys, os
   > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
--- a/tests/test-fncache.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-fncache.t	Sun Feb 20 15:28:44 2022 -0700
@@ -4,7 +4,6 @@
 does not break
 
   $ cat > chunksize.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import store
   > store.fncache_chunksize = 1
   > EOF
@@ -232,7 +231,6 @@
 Aborting lock does not prevent fncache writes
 
   $ cat > exceptionext.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > from mercurial import commands, error, extensions
   > 
@@ -279,7 +277,6 @@
 Aborting transaction prevents fncache change
 
   $ cat > ../exceptionext.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > from mercurial import commands, error, extensions, localrepo
   > 
@@ -315,7 +312,6 @@
 Aborted transactions can be recovered later
 
   $ cat > ../exceptionext.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > from mercurial import (
   >   commands,
@@ -483,7 +479,6 @@
 changesets that only contain changes to existing files:
 
   $ cat > fncacheloadwarn.py << EOF
-  > from __future__ import absolute_import
   > from mercurial import extensions, localrepo
   > 
   > def extsetup(ui):
--- a/tests/test-hardlinks.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-hardlinks.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,7 +1,6 @@
 #require hardlink reporevlogstore
 
   $ cat > nlinks.py <<EOF
-  > from __future__ import print_function
   > import sys
   > from mercurial import pycompat, util
   > for f in sorted(sys.stdin.readlines()):
@@ -17,7 +16,6 @@
 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
 
   $ cat > linkcp.py <<EOF
-  > from __future__ import absolute_import
   > import sys
   > from mercurial import pycompat, util
   > util.copyfiles(pycompat.fsencode(sys.argv[1]),
--- a/tests/test-help.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-help.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1792,7 +1792,6 @@
   > 
   > This paragraph is never omitted, too (for extension)
   > '''
-  > from __future__ import absolute_import
   > from mercurial import commands, help
   > testtopic = br"""This paragraph is never omitted (for topic).
   > 
--- a/tests/test-hgweb-no-path-info.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-hgweb-no-path-info.t	Sun Feb 20 15:28:44 2022 -0700
@@ -15,7 +15,6 @@
   summary:     test
   
   $ cat > request.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > from mercurial import (
--- a/tests/test-hgweb-no-request-uri.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-hgweb-no-request-uri.t	Sun Feb 20 15:28:44 2022 -0700
@@ -15,7 +15,6 @@
   summary:     test
   
   $ cat > request.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > from mercurial import (
--- a/tests/test-hgweb-non-interactive.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-hgweb-non-interactive.t	Sun Feb 20 15:28:44 2022 -0700
@@ -7,7 +7,6 @@
   $ hg add bar
   $ hg commit -m "test"
   $ cat > request.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > from mercurial import (
--- a/tests/test-hook.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-hook.t	Sun Feb 20 15:28:44 2022 -0700
@@ -831,7 +831,6 @@
   $ cd "$TESTTMP/b"
 
   $ cat > hooktests.py <<EOF
-  > from __future__ import print_function
   > from mercurial import (
   >     error,
   >     pycompat,
--- a/tests/test-impexp-branch.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-impexp-branch.t	Sun Feb 20 15:28:44 2022 -0700
@@ -2,7 +2,6 @@
   $ echo 'strip =' >> $HGRCPATH
 
   $ cat >findbranch.py <<EOF
-  > from __future__ import absolute_import
   > import re
   > import sys
   > 
--- a/tests/test-import.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-import.t	Sun Feb 20 15:28:44 2022 -0700
@@ -71,7 +71,6 @@
 regardless of the commit message in the patch)
 
   $ cat > dummypatch.py <<EOF
-  > from __future__ import print_function
   > print('patching file a')
   > open('a', 'wb').write(b'line2\n')
   > EOF
--- a/tests/test-imports-checker.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-imports-checker.t	Sun Feb 20 15:28:44 2022 -0700
@@ -16,74 +16,61 @@
   $ touch testpackage/__init__.py
 
   $ cat > testpackage/multiple.py << EOF
-  > from __future__ import absolute_import
   > import os, sys
   > EOF
 
   $ cat > testpackage/unsorted.py << EOF
-  > from __future__ import absolute_import
   > import sys
   > import os
   > EOF
 
   $ cat > testpackage/stdafterlocal.py << EOF
-  > from __future__ import absolute_import
   > from . import unsorted
   > import os
   > EOF
 
   $ cat > testpackage/requirerelative.py << EOF
-  > from __future__ import absolute_import
   > import testpackage.unsorted
   > EOF
 
   $ cat > testpackage/importalias.py << EOF
-  > from __future__ import absolute_import
   > import ui
   > EOF
 
   $ cat > testpackage/relativestdlib.py << EOF
-  > from __future__ import absolute_import
   > from .. import os
   > EOF
 
   $ cat > testpackage/stdlibfrom.py << EOF
-  > from __future__ import absolute_import
   > from collections import abc
   > EOF
 
   $ cat > testpackage/symbolimport.py << EOF
-  > from __future__ import absolute_import
   > from .unsorted import foo
   > EOF
 
   $ cat > testpackage/latesymbolimport.py << EOF
-  > from __future__ import absolute_import
   > from . import unsorted
   > from mercurial.node import hex
   > EOF
 
   $ cat > testpackage/multiplegroups.py << EOF
-  > from __future__ import absolute_import
   > from . import unsorted
   > from . import more
   > EOF
 
   $ mkdir testpackage/subpackage
   $ cat > testpackage/subpackage/levelpriority.py << EOF
-  > from __future__ import absolute_import
   > from . import foo
   > from .. import parent
   > EOF
 
   $ touch testpackage/subpackage/foo.py
   $ cat > testpackage/subpackage/__init__.py << EOF
-  > from __future__ import absolute_import
   > from . import levelpriority  # should not cause cycle
   > EOF
 
   $ cat > testpackage/subpackage/localimport.py << EOF
-  > from __future__ import absolute_import
   > from . import foo
   > def bar():
   >     # should not cause "higher-level import should come first"
@@ -94,17 +81,14 @@
   > EOF
 
   $ cat > testpackage/importmodulefromsub.py << EOF
-  > from __future__ import absolute_import
   > from .subpackage import foo  # not a "direct symbol import"
   > EOF
 
   $ cat > testpackage/importsymbolfromsub.py << EOF
-  > from __future__ import absolute_import
   > from .subpackage import foo, nonmodule
   > EOF
 
   $ cat > testpackage/sortedentries.py << EOF
-  > from __future__ import absolute_import
   > from . import (
   >     foo,
   >     bar,
@@ -112,12 +96,10 @@
   > EOF
 
   $ cat > testpackage/importfromalias.py << EOF
-  > from __future__ import absolute_import
   > from . import ui
   > EOF
 
   $ cat > testpackage/importfromrelative.py << EOF
-  > from __future__ import absolute_import
   > from testpackage.unsorted import foo
   > EOF
 
@@ -125,7 +107,6 @@
   $ touch testpackage2/__init__.py
 
   $ cat > testpackage2/latesymbolimport.py << EOF
-  > from __future__ import absolute_import
   > from testpackage import unsorted
   > from mercurial.node import hex
   > EOF
@@ -137,29 +118,28 @@
   $ touch email/__init__.py
   $ touch email/errors.py
   $ cat > email/utils.py << EOF
-  > from __future__ import absolute_import
   > from . import errors
   > EOF
 
   $ "$PYTHON" "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \
   >   email/*.py
-  testpackage/importalias.py:2: ui module must be "as" aliased to uimod
-  testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod
-  testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted
-  testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted
-  testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage
-  testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
-  testpackage/multiple.py:2: multiple imported names: os, sys
-  testpackage/multiplegroups.py:3: multiple "from . import" statements
-  testpackage/relativestdlib.py:2: relative import of stdlib module
-  testpackage/requirerelative.py:2: import should be relative: testpackage.unsorted
-  testpackage/sortedentries.py:2: imports from testpackage not lexically sorted: bar < foo
-  testpackage/stdafterlocal.py:3: stdlib import "os" follows local import: testpackage
-  testpackage/stdlibfrom.py:2: direct symbol import abc from collections
-  testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage
-  testpackage/subpackage/localimport.py:7: multiple "from .. import" statements
-  testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority
-  testpackage/symbolimport.py:2: direct symbol import foo from testpackage.unsorted
-  testpackage/unsorted.py:3: imports not lexically sorted: os < sys
-  testpackage2/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node
+  testpackage/importalias.py:1: ui module must be "as" aliased to uimod
+  testpackage/importfromalias.py:1: ui from testpackage must be "as" aliased to uimod
+  testpackage/importfromrelative.py:1: import should be relative: testpackage.unsorted
+  testpackage/importfromrelative.py:1: direct symbol import foo from testpackage.unsorted
+  testpackage/importsymbolfromsub.py:1: direct symbol import nonmodule from testpackage.subpackage
+  testpackage/latesymbolimport.py:2: symbol import follows non-symbol import: mercurial.node
+  testpackage/multiple.py:1: multiple imported names: os, sys
+  testpackage/multiplegroups.py:2: multiple "from . import" statements
+  testpackage/relativestdlib.py:1: relative import of stdlib module
+  testpackage/requirerelative.py:1: import should be relative: testpackage.unsorted
+  testpackage/sortedentries.py:1: imports from testpackage not lexically sorted: bar < foo
+  testpackage/stdafterlocal.py:2: stdlib import "os" follows local import: testpackage
+  testpackage/stdlibfrom.py:1: direct symbol import abc from collections
+  testpackage/subpackage/levelpriority.py:2: higher-level import should come first: testpackage
+  testpackage/subpackage/localimport.py:6: multiple "from .. import" statements
+  testpackage/subpackage/localimport.py:7: import should be relative: testpackage.subpackage.levelpriority
+  testpackage/symbolimport.py:1: direct symbol import foo from testpackage.unsorted
+  testpackage/unsorted.py:2: imports not lexically sorted: os < sys
+  testpackage2/latesymbolimport.py:2: symbol import follows non-symbol import: mercurial.node
   [1]
--- a/tests/test-inherit-mode.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-inherit-mode.t	Sun Feb 20 15:28:44 2022 -0700
@@ -10,7 +10,6 @@
   $ cd dir
 
   $ cat >printmodes.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > 
@@ -31,7 +30,6 @@
   > EOF
 
   $ cat >mode.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > print('%05o' % os.lstat(sys.argv[1]).st_mode)
--- a/tests/test-largefiles-cache.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-largefiles-cache.t	Sun Feb 20 15:28:44 2022 -0700
@@ -96,7 +96,6 @@
 
   $ cat > ls-l.py <<EOF
   > #!$PYTHON
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > path = sys.argv[1]
--- a/tests/test-largefiles-small-disk.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-largefiles-small-disk.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,7 +1,6 @@
 Test how largefiles abort in case the disk runs full
 
   $ cat > criple.py <<EOF
-  > from __future__ import absolute_import
   > import errno
   > import os
   > import shutil
--- a/tests/test-log-exthook.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-log-exthook.t	Sun Feb 20 15:28:44 2022 -0700
@@ -2,7 +2,6 @@
 -------------------------------------------
 
   $ cat > $TESTTMP/logexthook.py <<EOF
-  > from __future__ import absolute_import
   > import codecs
   > from mercurial import (
   >   commands,
--- a/tests/test-log.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-log.t	Sun Feb 20 15:28:44 2022 -0700
@@ -2451,7 +2451,6 @@
 
   $ cat > ../names.py <<EOF
   > """A small extension to test adding arbitrary names to a repo"""
-  > from __future__ import absolute_import
   > from mercurial import namespaces
   > 
   > def reposetup(ui, repo):
--- a/tests/test-logtoprocess.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-logtoprocess.t	Sun Feb 20 15:28:44 2022 -0700
@@ -8,7 +8,6 @@
 
   $ hg init
   $ cat > $TESTTMP/foocommand.py << EOF
-  > from __future__ import absolute_import
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
--- a/tests/test-merge-symlinks.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-merge-symlinks.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,6 +1,5 @@
   $ cat > echo.py <<EOF
   > #!$PYTHON
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > try:
--- a/tests/test-merge1.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-merge1.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,5 +1,4 @@
   $ cat <<EOF > merge
-  > from __future__ import print_function
   > import sys, os
   > 
   > try:
@@ -354,7 +353,6 @@
 trigger it. If you see flakyness here, there is a race.
 
   $ cat > $TESTTMP/abort.py <<EOF
-  > from __future__ import absolute_import
   > # emulate aborting before "recordupdates()". in this case, files
   > # are changed without updating dirstate
   > from mercurial import (
--- a/tests/test-narrow-clone-non-narrow-server.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-narrow-clone-non-narrow-server.t	Sun Feb 20 15:28:44 2022 -0700
@@ -20,7 +20,6 @@
 Verify that narrow is advertised in the bundle2 capabilities:
 
   $ cat >> unquote.py <<EOF
-  > from __future__ import print_function
   > import sys
   > if sys.version[0] == '3':
   >     import urllib.parse as up
--- a/tests/test-notify.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-notify.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,5 +1,4 @@
   $ cat > $TESTTMP/filter.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import io
   > import re
   > import sys
--- a/tests/test-obsolete.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-obsolete.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1465,7 +1465,6 @@
 Test heads computation on pending index changes with obsolescence markers
   $ cd ..
   $ cat >$TESTTMP/test_extension.py  << EOF
-  > from __future__ import absolute_import
   > from mercurial.i18n import _
   > from mercurial import cmdutil, pycompat, registrar
   > from mercurial.utils import stringutil
@@ -1499,7 +1498,6 @@
 bookmarks change
   $ cd ..
   $ cat >$TESTTMP/test_extension.py  << EOF
-  > from __future__ import absolute_import, print_function
   > import weakref
   > from mercurial import (
   >   bookmarks,
--- a/tests/test-pager.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-pager.t	Sun Feb 20 15:28:44 2022 -0700
@@ -411,7 +411,6 @@
 
 Environment variables like LESS and LV are set automatically:
   $ cat > $TESTTMP/printlesslv.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > sys.stdin.read()
--- a/tests/test-parseindex.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-parseindex.t	Sun Feb 20 15:28:44 2022 -0700
@@ -26,7 +26,6 @@
   summary:     change foo
   
   $ cat >> test.py << EOF
-  > from __future__ import print_function
   > from mercurial import changelog, node, pycompat, vfs
   > 
   > class singlebyteread(object):
@@ -75,7 +74,6 @@
   $ cd a
 
   $ "$PYTHON" <<EOF
-  > from __future__ import print_function
   > from mercurial import changelog, vfs
   > cl = changelog.changelog(vfs.vfs(b'.hg/store'))
   > print('good heads:')
@@ -177,7 +175,6 @@
         1       2        1       -1    base         66         65         66   1.01538        66         0    0.00000
 
   $ cat <<EOF > test.py
-  > from __future__ import print_function
   > import sys
   > from mercurial import changelog, pycompat, vfs
   > cl = changelog.changelog(vfs.vfs(pycompat.fsencode(sys.argv[1])))
--- a/tests/test-patch.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-patch.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,5 +1,4 @@
   $ cat > patchtool.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import sys
   > print('Using custom patch')
   > if '--binary' in sys.argv:
--- a/tests/test-patchbomb.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-patchbomb.t	Sun Feb 20 15:28:44 2022 -0700
@@ -8,7 +8,6 @@
 --===+[0-9]+=+$ -> --===*= (glob)
 
   $ cat > prune-blank-after-boundary.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import sys
   > skipblank = False
   > trim = lambda x: x.strip(' \r\n')
--- a/tests/test-profile.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-profile.t	Sun Feb 20 15:28:44 2022 -0700
@@ -132,7 +132,6 @@
 profiler extension could be loaded before other extensions
 
   $ cat > fooprof.py <<EOF
-  > from __future__ import absolute_import
   > import contextlib
   > import sys
   > @contextlib.contextmanager
@@ -147,7 +146,6 @@
   > EOF
 
   $ cat > otherextension.py <<EOF
-  > from __future__ import absolute_import
   > def extsetup(ui):
   >     ui.write(b'otherextension: loaded\n')
   > EOF
--- a/tests/test-progress.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-progress.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,6 +1,5 @@
 
   $ cat > loop.py <<EOF
-  > from __future__ import absolute_import
   > import time
   > from mercurial import commands, registrar
   > 
--- a/tests/test-rebase-dest.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-rebase-dest.t	Sun Feb 20 15:28:44 2022 -0700
@@ -81,7 +81,6 @@
   $ cd $TESTTMP
 
   $ cat >> $TESTTMP/maprevset.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import registrar, revset, revsetlang, smartset
   > revsetpredicate = registrar.revsetpredicate()
   > cache = {}
--- a/tests/test-rebase-scenario-global.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-rebase-scenario-global.t	Sun Feb 20 15:28:44 2022 -0700
@@ -949,7 +949,6 @@
   $ hg init tr-state
   $ cd tr-state
   $ cat > $TESTTMP/wraprebase.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import extensions
   > def _rebase(orig, ui, repo, *args, **kwargs):
   >     with repo.wlock():
--- a/tests/test-relink.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-relink.t	Sun Feb 20 15:28:44 2022 -0700
@@ -8,7 +8,6 @@
   > }
 
   $ cat > arelinked.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import os
   > import sys
   > from mercurial import (
--- a/tests/test-requires.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-requires.t	Sun Feb 20 15:28:44 2022 -0700
@@ -32,7 +32,6 @@
 
   $ echo 'featuresetup-test' >> supported/.hg/requires
   $ cat > $TESTTMP/supported-locally/supportlocally.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import extensions, localrepo
   > def featuresetup(ui, supported):
   >     for name, module in extensions.extensions(ui):
--- a/tests/test-revert.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-revert.t	Sun Feb 20 15:28:44 2022 -0700
@@ -550,7 +550,6 @@
 
   $ cat << EOF >> dircontent.py
   > # generate a simple text view of the directory for easy comparison
-  > from __future__ import print_function
   > import os
   > files = os.listdir('.')
   > files.sort()
--- a/tests/test-revlog-mmapindex.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-revlog-mmapindex.t	Sun Feb 20 15:28:44 2022 -0700
@@ -2,7 +2,6 @@
   $ cat << EOF > verbosemmap.py
   > # extension to make util.mmapread verbose
   > 
-  > from __future__ import absolute_import
   > 
   > from mercurial import (
   >     extensions,
--- a/tests/test-revset.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-revset.t	Sun Feb 20 15:28:44 2022 -0700
@@ -36,7 +36,6 @@
 these predicates use '\0' as a separator:
 
   $ cat <<EOF > debugrevlistspec.py
-  > from __future__ import absolute_import
   > from mercurial import (
   >     node as nodemod,
   >     registrar,
--- a/tests/test-share-bookmarks.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-share-bookmarks.t	Sun Feb 20 15:28:44 2022 -0700
@@ -222,7 +222,6 @@
 
   $ cat > failpullbookmarks.py << EOF
   > """A small extension that makes bookmark pulls fail, for testing"""
-  > from __future__ import absolute_import
   > from mercurial import (
   >   error,
   >   exchange,
--- a/tests/test-ssh-proto-unbundle.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-ssh-proto-unbundle.t	Sun Feb 20 15:28:44 2022 -0700
@@ -99,7 +99,6 @@
 Test pushing to a server that has a pretxnchangegroup Python hook that fails
 
   $ cat > $TESTTMP/failhook << EOF
-  > from __future__ import print_function
   > import sys
   > def hook1line(ui, repo, **kwargs):
   >     ui.write(b'ui.write 1 line\n')
--- a/tests/test-strip.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-strip.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1290,7 +1290,6 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo 3 >> I
   $ cat > $TESTTMP/delayedstrip.py <<EOF
-  > from __future__ import absolute_import
   > from mercurial import commands, registrar, repair
   > cmdtable = {}
   > command = registrar.command(cmdtable)
--- a/tests/test-template-functions.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-template-functions.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1572,7 +1572,6 @@
 Test cbor filter:
 
   $ cat <<'EOF' > "$TESTTMP/decodecbor.py"
-  > from __future__ import absolute_import
   > from mercurial import (
   >     dispatch,
   > )
--- a/tests/test-template-map.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-template-map.t	Sun Feb 20 15:28:44 2022 -0700
@@ -722,7 +722,6 @@
 test CBOR style:
 
   $ cat <<'EOF' > "$TESTTMP/decodecborarray.py"
-  > from __future__ import absolute_import
   > from mercurial import (
   >     dispatch,
   > )
--- a/tests/test-update-atomic.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-update-atomic.t	Sun Feb 20 15:28:44 2022 -0700
@@ -3,7 +3,6 @@
 Checking that experimental.atomic-file works.
 
   $ cat > $TESTTMP/show_mode.py <<EOF
-  > from __future__ import print_function
   > import os
   > import stat
   > import sys
@@ -20,7 +19,6 @@
   $ cd repo
 
   $ cat > .hg/showwrites.py <<EOF
-  > from __future__ import print_function
   > from mercurial import pycompat
   > from mercurial.utils import stringutil
   > def uisetup(ui):
--- a/tests/test-verify.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-verify.t	Sun Feb 20 15:28:44 2022 -0700
@@ -338,7 +338,6 @@
   checked 1 changesets with 1 changes to 1 files
 
   $ cat >> $TESTTMP/break-base64.py <<EOF
-  > from __future__ import absolute_import
   > import base64
   > base64.b64decode=lambda x: x
   > EOF
--- a/tests/test-walk.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-walk.t	Sun Feb 20 15:28:44 2022 -0700
@@ -640,7 +640,6 @@
   $ cd t
   $ echo fennel > overflow.list
   $ cat >> printnum.py <<EOF
-  > from __future__ import print_function
   > for i in range(20000 // 100):
   >   print('x' * 100)
   > EOF
--- a/tests/test-worker.t	Thu Mar 03 17:34:00 2022 +0100
+++ b/tests/test-worker.t	Sun Feb 20 15:28:44 2022 -0700
@@ -1,7 +1,6 @@
 Test UI worker interaction
 
   $ cat > t.py <<EOF
-  > from __future__ import absolute_import, print_function
   > import sys
   > import time
   > from mercurial import (
@@ -100,7 +99,6 @@
 Workers should not do cleanups in all cases
 
   $ cat > $TESTTMP/detectcleanup.py <<EOF
-  > from __future__ import absolute_import
   > import atexit
   > import os
   > import sys
@@ -134,7 +132,6 @@
 Do not crash on partially read result
 
   $ cat > $TESTTMP/detecttruncated.py <<EOF
-  > from __future__ import absolute_import
   > import os
   > import sys
   > import time