[PATCH 4 of 8] tests: make test-ui-color use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Tue Apr 12 13:37:41 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460481162 -19800
#      Tue Apr 12 22:42:42 2016 +0530
# Node ID 787c08cf0ff65d3e6e9542a6e60ba11d9d59b48e
# Parent  c30c2951ce4669b52049ffce3229dbca80df6622
tests: make test-ui-color 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-ui-color.py not using absolute_import
 
 #if py3exe
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
diff --git a/tests/test-ui-color.py b/tests/test-ui-color.py
--- a/tests/test-ui-color.py
+++ b/tests/test-ui-color.py
@@ -1,7 +1,12 @@
-from __future__ import print_function
+from __future__ import absolute_import, print_function
 import os
-from hgext import color
-from mercurial import dispatch, ui
+from hgext import (
+    color,
+)
+from mercurial import (
+    dispatch,
+    ui as uimod,
+)
 
 # ensure errors aren't buffered
 testui = color.colorui()
@@ -17,7 +22,7 @@
 hgrc.write('color=\n')
 hgrc.close()
 
-ui_ = ui.ui()
+ui_ = uimod.ui()
 ui_.setconfig('ui', 'formatted', 'True')
 
 # we're not interested in the output, so write that to devnull


More information about the Mercurial-devel mailing list