comparison tests/test-parseindex2.py @ 38095:3de58f50afa2

tests: fix test-parseindex2 on Python 3 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. Differential Revision: https://phab.mercurial-scm.org/D3622
author Augie Fackler <augie@google.com>
date Sat, 19 May 2018 15:53:31 -0400
parents 2f00c6e8f6a1
children a3dacabd476b
comparison
equal deleted inserted replaced
38094:e504fa630860 38095:3de58f50afa2
13 nullid, 13 nullid,
14 nullrev, 14 nullrev,
15 ) 15 )
16 from mercurial import ( 16 from mercurial import (
17 policy, 17 policy,
18 pycompat,
18 ) 19 )
19 20
20 parsers = policy.importmod(r'parsers') 21 parsers = policy.importmod(r'parsers')
21 22
22 # original python implementation 23 # original python implementation
147 printhexfail(testnumber, hexversion, stdout, expected="no stdout") 148 printhexfail(testnumber, hexversion, stdout, expected="no stdout")
148 149
149 def testversionfail(testnumber, hexversion): 150 def testversionfail(testnumber, hexversion):
150 stdout, stderr = importparsers(hexversion) 151 stdout, stderr = importparsers(hexversion)
151 # We include versionerrortext to distinguish from other ImportErrors. 152 # We include versionerrortext to distinguish from other ImportErrors.
152 errtext = "ImportError: %s" % parsers.versionerrortext 153 errtext = b"ImportError: %s" % pycompat.sysbytes(parsers.versionerrortext)
153 if errtext not in stdout: 154 if errtext not in stdout:
154 printhexfail(testnumber, hexversion, stdout, 155 printhexfail(testnumber, hexversion, stdout,
155 expected="stdout to contain %r" % errtext) 156 expected="stdout to contain %r" % errtext)
156 157
157 def makehex(major, minor, micro): 158 def makehex(major, minor, micro):