diff tests/test-revlog.t @ 40281:29b0e9cd02f4

py3: fix test-revlog.t The mpatchError has a trailing comma on Python 2 but not on Python 3, so use a glob to handle both Python 2 and Python 3. Differential Revision: https://phab.mercurial-scm.org/D5093
author Mark Thomas <mbthomas@fb.com>
date Sun, 14 Oct 2018 09:07:43 +0000
parents 803b7569c9ea
children 95c4cca641f6
line wrap: on
line diff
--- a/tests/test-revlog.t	Sun Oct 14 04:11:35 2018 -0400
+++ b/tests/test-revlog.t	Sun Oct 14 09:07:43 2018 +0000
@@ -34,10 +34,11 @@
 
   $ hg init
 
-  >>> open("a.i", "wb").write(
+  >>> import codecs
+  >>> open("a.i", "wb").write(codecs.decode(codecs.decode(
   ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD
-  ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA=="""
-  ... .decode("base64").decode("zlib")) and None
+  ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""",
+  ... "base64"), "zlib")) and None
 
   $ hg debugrevlogindex a.i
      rev linkrev nodeid       p1           p2
@@ -49,4 +50,4 @@
   >>> tvfs.options = {b'revlogv1': True}
   >>> rl = revlog.revlog(tvfs, b'a.i')
   >>> rl.revision(1)
-  mpatchError('patch cannot be decoded',)
+  mpatchError(*'patch cannot be decoded'*) (glob)