Patchwork D7192: py3: fix exception message check in test-linerange.py's testOutOfRange

login
register
mail settings
Submitter phabricator
Date Nov. 1, 2019, 4:46 p.m.
Message ID <differential-rev-PHID-DREV-vjxxgyonjik6wp3jouhe-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42657/
State Superseded
Headers show

Comments

phabricator - Nov. 1, 2019, 4:46 p.m.
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-linerange.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-linerange.py b/tests/test-linerange.py
--- a/tests/test-linerange.py
+++ b/tests/test-linerange.py
@@ -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,7 @@ 
             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__)