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

login
register
mail settings
Submitter phabricator
Date Nov. 1, 2019, 5:28 p.m.
Message ID <7d1109a3db7c66b5ac9e5b90bae3a76a@localhost.localdomain>
Download mbox | patch
Permalink /patch/42663/
State Not Applicable
Headers show

Comments

phabricator - Nov. 1, 2019, 5:28 p.m.
Closed by commit rHG5c12a381fab3: py3: fix exception message check in test-linerange.py&#039;s testOutOfRange (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7192?vs=17446&id=17455

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7192/new/

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

AFFECTED FILES
  tests/test-linerange.py

CHANGE DETAILS




To: touilleMan, #hg-reviewers, indygreg
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__)