D3622: tests: fix test-parseindex2 on Python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat May 19 20:10:31 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  parsers.versionerrortext is a sysstr, but it's only ever used in this
  test on the Python side, so I'm okay to just handle it like this.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-parseindex2.py

CHANGE DETAILS

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -15,6 +15,7 @@
 )
 from mercurial import (
     policy,
+    pycompat,
 )
 
 parsers = policy.importmod(r'parsers')
@@ -149,7 +150,7 @@
 def testversionfail(testnumber, hexversion):
     stdout, stderr = importparsers(hexversion)
     # We include versionerrortext to distinguish from other ImportErrors.
-    errtext = "ImportError: %s" % parsers.versionerrortext
+    errtext = b"ImportError: %s" % pycompat.sysbytes(parsers.versionerrortext)
     if errtext not in stdout:
         printhexfail(testnumber, hexversion, stdout,
                      expected="stdout to contain %r" % errtext)



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


More information about the Mercurial-devel mailing list