tests: fix various test-check-module-imports.t violations
Somehow these are only caught when running the test under Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2580
--- a/tests/test-i18n.t Tue Feb 27 00:33:46 2018 +0530
+++ b/tests/test-i18n.t Sat Mar 03 09:35:59 2018 -0500
@@ -54,8 +54,8 @@
Check i18n cache isn't reused after encoding change:
$ cat > $TESTTMP/encodingchange.py << EOF
+ > from mercurial.i18n import _
> from mercurial import encoding, registrar
- > from mercurial.i18n import _
> cmdtable = {}
> command = registrar.command(cmdtable)
> @command(b'encodingchange', norepo=True)
--- a/tests/test-lfs.t Tue Feb 27 00:33:46 2018 +0530
+++ b/tests/test-lfs.t Sat Mar 03 09:35:59 2018 -0500
@@ -616,8 +616,8 @@
$ cat > $TESTTMP/dumpflog.py << EOF
> # print raw revision sizes, flags, and hashes for certain files
> import hashlib
+ > from mercurial.node import short
> from mercurial import revlog
- > from mercurial.node import short
> def hash(rawtext):
> h = hashlib.sha512()
> h.update(rawtext)
--- a/tests/test-resolve.t Tue Feb 27 00:33:46 2018 +0530
+++ b/tests/test-resolve.t Sat Mar 03 09:35:59 2018 -0500
@@ -85,7 +85,12 @@
$ cat > $TESTTMP/markdriver.py << EOF
> '''mark and unmark files as driver-resolved'''
- > from mercurial import merge, registrar, scmutil, pycompat
+ > from mercurial import (
+ > merge,
+ > pycompat,
+ > registrar,
+ > scmutil,
+ > )
> cmdtable = {}
> command = registrar.command(cmdtable)
> @command(b'markdriver',
--- a/tests/test-rollback.t Tue Feb 27 00:33:46 2018 +0530
+++ b/tests/test-rollback.t Sat Mar 03 09:35:59 2018 -0500
@@ -220,8 +220,8 @@
> import errno
> from mercurial.i18n import _
> from mercurial import (
+ > error,
> registrar,
- > error,
> ui as uimod,
> )
>
--- a/tests/test-split.t Tue Feb 27 00:33:46 2018 +0530
+++ b/tests/test-split.t Sat Mar 03 09:35:59 2018 -0500
@@ -2,7 +2,8 @@
$ cat > $TESTTMP/editor.py <<EOF
> #!$PYTHON
- > import os, sys
+ > import os
+ > import sys
> path = os.path.join(os.environ['TESTTMP'], 'messages')
> messages = open(path).read().split('--\n')
> prompt = open(sys.argv[1]).read()