changeset 28913:b4048ce003fb

tests: make test-trusted use absolute_import
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 14 Apr 2016 00:49:58 +0530
parents 867d6ba2353d
children 63fe5ddb8715
files tests/test-check-py3-compat.t tests/test-trusted.py
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-py3-compat.t	Sun Mar 27 20:31:56 2016 +0900
+++ b/tests/test-check-py3-compat.t	Thu Apr 14 00:49:58 2016 +0530
@@ -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
--- a/tests/test-trusted.py	Sun Mar 27 20:31:56 2016 +0900
+++ b/tests/test-trusted.py	Thu Apr 14 00:49:58 2016 +0530
@@ -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 = uimod.ui()
     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()