Patchwork D3512: tests: port test-ui-color.py to Python 3

login
register
mail settings
Submitter phabricator
Date May 10, 2018, 10:42 a.m.
Message ID <814edba6c344be7f2236d4f1e2807ade@localhost.localdomain>
Download mbox | patch
Permalink /patch/31448/
State Not Applicable
Headers show

Comments

phabricator - May 10, 2018, 10:42 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb8c2004a8d2b: tests: port test-ui-color.py to Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3512?vs=8586&id=8605

REVISION DETAIL
  https://phab.mercurial-scm.org/D3512

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-ui-color.py
  tests/test-ui-color.py.out

CHANGE DETAILS




To: durin42, pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-ui-color.py.out b/tests/test-ui-color.py.out
--- a/tests/test-ui-color.py.out
+++ b/tests/test-ui-color.py.out
@@ -1,5 +1,5 @@ 
 warning
 error
-'buffered\n'
+b'buffered\n'
 colored? True
 colored? True
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
@@ -5,14 +5,17 @@ 
     dispatch,
     ui as uimod,
 )
+from mercurial.utils import (
+    stringutil,
+)
 
 # ensure errors aren't buffered
 testui = uimod.ui()
 testui.pushbuffer()
 testui.write((b'buffered\n'))
 testui.warn((b'warning\n'))
 testui.write_err(b'error\n')
-print(repr(testui.popbuffer()))
+print(stringutil.pprint(testui.popbuffer()).decode('ascii'))
 
 # test dispatch.dispatch with the same ui object
 hgrc = open(os.environ["HGRCPATH"], 'wb')
@@ -35,4 +38,3 @@ 
 print("colored? %s" % (ui_._colormode is not None))
 runcmd()
 print("colored? %s" % (ui_._colormode is not None))
-
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -450,6 +450,7 @@ 
 test-tags.t
 test-template-engine.t
 test-treemanifest.t
+test-ui-color.py
 test-unamend.t
 test-uncommit.t
 test-unified-test.t