changeset 1584:2b342625a92a

test: add compat code for removed revlog.LookupError in test_push_command.py revlog.LookupError was removed recently. If that's not present, we will use error.LookupEror instead. revlog.LookupError was split into three different errors which subclasses error.LookupError, so catching error.LookupError is fine.
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 24 Oct 2018 15:21:09 +0300
parents f778fdd82c83
children d6b75cf2c27d
files tests/test_push_command.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -25,6 +25,10 @@ import time
 
 revsymbol = test_util.revsymbol
 
+try:
+    lookuperror = revlog.LookupError
+except AttributeError:
+    lookuperror = hgerror.LookupError
 
 class PushTests(test_util.TestBase):
     obsolete_mode_tests = True
@@ -350,7 +354,7 @@ class PushTests(test_util.TestBase):
         try:
             self.assertEqual(tip.parents()[0]['adding_file2'].data(), 'foo')
             assert False, "this is impossible, adding_file2 should not be in this manifest."
-        except revlog.LookupError, e:
+        except lookuperror, e:
             pass
         self.assertEqual(tip.branch(), 'default')