py3: fix exception message check in test-linerange.py's testOutOfRange stable
authorEmmanuel Leblond <emmanuel.leblond@gmail.com>
Fri, 01 Nov 2019 17:31:47 +0100
branchstable
changeset 43366 ee3a55c8fd0f
parent 43365 899e55e2d375
child 43367 3c2799cbace4
py3: fix exception message check in test-linerange.py's testOutOfRange Differential Revision: https://phab.mercurial-scm.org/D7192
tests/test-linerange.py
--- a/tests/test-linerange.py	Fri Nov 01 17:35:36 2019 +0100
+++ b/tests/test-linerange.py	Fri Nov 01 17:31:47 2019 +0100
@@ -2,6 +2,7 @@
 
 import unittest
 from mercurial import error, mdiff
+from mercurial.utils import stringutil
 
 # for readability, line numbers are 0-origin
 text1 = b'''
@@ -228,7 +229,10 @@
             try:
                 mdiff.blocksinrange(self.blocks, linerange2)
             except exctype as exc:
-                self.assertTrue('line range exceeds file size' in str(exc))
+                self.assertTrue(
+                    b'line range exceeds file size'
+                    in stringutil.forcebytestr(exc)
+                )
             else:
                 self.fail('%s not raised' % exctype.__name__)