[PATCH 1 of 8 v2] tests: make test-trusted use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Tue Apr 12 20:48:15 UTC 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460492888 -19800
#      Wed Apr 13 01:58:08 2016 +0530
# Node ID f05f5bc8ea2f98a3f77232d8a50745014363c115
# Parent  16255662446d2ce08bd0a4210df30afe3d6377f6
tests: make test-trusted use absolute_import

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
@@ -65,7 +65,6 @@
   tests/test-run-tests.py not using absolute_import
   tests/test-simplemerge.py not using absolute_import
   tests/test-symlink-os-yes-fs-no.py not using absolute_import
-  tests/test-trusted.py not using absolute_import
   tests/test-trusted.py requires print_function
   tests/test-ui-color.py not using absolute_import
   tests/test-url.py not using absolute_import
diff --git a/tests/test-trusted.py b/tests/test-trusted.py
--- a/tests/test-trusted.py
+++ b/tests/test-trusted.py
@@ -2,8 +2,14 @@
 # with files from different users/groups, we cheat a bit by
 # monkey-patching some functions in the util module
 
+from __future__ import absolute_import
+
 import os
-from mercurial import ui, util, error
+from mercurial import (
+    error,
+    ui as uimod,
+    util,
+)
 
 hgrc = os.environ['HGRCPATH']
 f = open(hgrc)
@@ -60,7 +66,7 @@
     print '# %s user, %s group%s' % (kind[user == cuser], kind[group == cgroup],
                                      trusted)
 
-    u = ui.ui()
+    u = ui.uimod()
     u.setconfig('ui', 'debug', str(bool(debug)))
     u.setconfig('ui', 'report_untrusted', str(bool(report)))
     u.readconfig('.hg/hgrc')
@@ -150,7 +156,7 @@
 
 print
 print "# read trusted, untrusted, new ui, trusted"
-u = ui.ui()
+u = uimod.ui()
 u.setconfig('ui', 'debug', 'on')
 u.readconfig(filename)
 u2 = u.copy()


More information about the Mercurial-devel mailing list