tests: use assertTrue() instead of assert_() in test-bdiff.py
authorPulkit Goyal <pulkit@yandex-team.ru>
Sun, 23 Sep 2018 23:39:07 +0300
changeset 39789 e961f18a0094
parent 39788 69defbb83be7
child 39790 d3e940a32be0
tests: use assertTrue() instead of assert_() in test-bdiff.py The later is deprecated in Python 3. This patch also makes the test pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D4697
contrib/python3-whitelist
tests/test-bdiff.py
--- a/contrib/python3-whitelist	Sun Sep 23 23:35:38 2018 +0300
+++ b/contrib/python3-whitelist	Sun Sep 23 23:39:07 2018 +0300
@@ -22,6 +22,7 @@
 test-backwards-remove.t
 test-bad-pull.t
 test-basic.t
+test-bdiff.py
 test-bheads.t
 test-bisect.t
 test-bisect2.t
--- a/tests/test-bdiff.py	Sun Sep 23 23:35:38 2018 +0300
+++ b/tests/test-bdiff.py	Sun Sep 23 23:39:07 2018 +0300
@@ -99,9 +99,9 @@
                      diffreplace(12, 12, b'', b'b\nc\n.\n'),
                      b'd\ne\n',
                      diffreplace(16, 18, b'.\n', b''), b'f\n']
-        self.assert_(got in (want_c, want_pure),
-                     'got: %r, wanted either %r or %r' % (
-                         got, want_c, want_pure))
+        self.assertTrue(got in (want_c, want_pure),
+                        'got: %r, wanted either %r or %r' % (
+                            got, want_c, want_pure))
 
     def test_fixws(self):
         cases = [