changeset 28915:40afa22bee9b

tests: make test-ui-color use absolute_import
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 14 Apr 2016 00:56:08 +0530
parents 63fe5ddb8715
children 3b453513f1fe
files tests/test-check-py3-compat.t tests/test-ui-color.py
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-py3-compat.t	Thu Apr 14 00:53:35 2016 +0530
+++ b/tests/test-check-py3-compat.t	Thu Apr 14 00:56:08 2016 +0530
@@ -66,7 +66,6 @@
   tests/test-simplemerge.py not using absolute_import
   tests/test-symlink-os-yes-fs-no.py not using absolute_import
   tests/test-trusted.py requires print_function
-  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
--- a/tests/test-ui-color.py	Thu Apr 14 00:53:35 2016 +0530
+++ b/tests/test-ui-color.py	Thu Apr 14 00:56:08 2016 +0530
@@ -1,7 +1,13 @@
-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 +23,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