diff tests/test_branch.py @ 221:a2afbf236ca8

hglib tests: remove deprecated constructions This mostly removes usage of 'assertEquals' (replaced with 'assertEqual'), as well as opening files without closing them (fixed using a 'with' statement).
author Mathias De Mare <mathias.de_mare@nokia.com>
date Thu, 09 Mar 2023 14:00:02 +0100
parents 8341f2494b3f
children
line wrap: on
line diff
--- a/tests/test_branch.py	Thu Mar 09 11:33:04 2023 +0100
+++ b/tests/test_branch.py	Thu Mar 09 14:00:02 2023 +0100
@@ -4,17 +4,17 @@
 
 class test_branch(common.basetest):
     def test_empty(self):
-        self.assertEquals(self.client.branch(), b('default'))
+        self.assertEqual(self.client.branch(), b('default'))
 
     def test_basic(self):
-        self.assertEquals(self.client.branch(b('foo')), b('foo'))
+        self.assertEqual(self.client.branch(b('foo')), b('foo'))
         self.append('a', 'a')
         rev, node = self.client.commit(b('first'), addremove=True)
 
         rev = self.client.log(node)[0]
 
-        self.assertEquals(rev.branch, b('foo'))
-        self.assertEquals(self.client.branches(),
+        self.assertEqual(rev.branch, b('foo'))
+        self.assertEqual(self.client.branches(),
                           [(rev.branch, int(rev.rev), rev.node[:12])])
 
     def test_reset_with_name(self):
@@ -22,7 +22,7 @@
 
     def test_reset(self):
         self.client.branch(b('foo'))
-        self.assertEquals(self.client.branch(clean=True), b('default'))
+        self.assertEqual(self.client.branch(clean=True), b('default'))
 
     def test_exists(self):
         self.append('a', 'a')
@@ -42,5 +42,5 @@
 
         self.assertRaises(hglib.error.CommandError,
                           self.client.branch, b('default'))
-        self.assertEquals(self.client.branch(b('default'), force=True),
+        self.assertEqual(self.client.branch(b('default'), force=True),
                           b('default'))