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

touilleMan (Leblond Emmanuel) phabricator at mercurial-scm.org
Fri Nov 1 13:28:46 EDT 2019


Closed by commit rHG5c12a381fab3: py3: fix exception message check in test-linerange.py'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

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__)
 



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


More information about the Mercurial-devel mailing list