comparison tests/test-parseindex2.py @ 39046:a450d460774e

tests: restore Python 3 compat in test-parseindex2.py I think this was previously getting lucky in Python 3, and would have stacktraced if something failed. Now that failure messages are eagerly computed, this turned into a problem. Differential Revision: https://phab.mercurial-scm.org/D4182
author Augie Fackler <augie@google.com>
date Thu, 09 Aug 2018 13:34:33 -0400
parents 88b04bd2cbb4
children d722020bbd9d
comparison
equal deleted inserted replaced
39045:88b04bd2cbb4 39046:a450d460774e
13 from mercurial.node import ( 13 from mercurial.node import (
14 nullid, 14 nullid,
15 nullrev, 15 nullrev,
16 ) 16 )
17 from mercurial import ( 17 from mercurial import (
18 node as nodemod,
18 policy, 19 policy,
19 pycompat, 20 pycompat,
20 ) 21 )
21 22
22 parsers = policy.importmod(r'parsers') 23 parsers = policy.importmod(r'parsers')
199 if r[7] == nullid: 200 if r[7] == nullid:
200 i = -1 201 i = -1
201 try: 202 try:
202 self.assertEqual( 203 self.assertEqual(
203 ix[r[7]], i, 204 ix[r[7]], i,
204 'Reverse lookup inconsistent for %r' % r[7].encode('hex')) 205 'Reverse lookup inconsistent for %r' % nodemod.hex(r[7]))
205 except TypeError: 206 except TypeError:
206 # pure version doesn't support this 207 # pure version doesn't support this
207 break 208 break
208 209
209 if __name__ == '__main__': 210 if __name__ == '__main__':