Mercurial > python-hglib
diff tests/test_outgoing_incoming.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_outgoing_incoming.py Thu Mar 09 11:33:04 2023 +0100 +++ b/tests/test_outgoing_incoming.py Thu Mar 09 14:00:02 2023 +0100 @@ -10,8 +10,8 @@ self.client.clone(dest=b('other')) self.other = hglib.open(b('other')) - self.assertEquals(self.other.incoming(), []) - self.assertEquals(self.other.outgoing(), []) + self.assertEqual(self.other.incoming(), []) + self.assertEqual(self.other.outgoing(), []) def test_basic(self): self.append('a', 'a') @@ -22,18 +22,18 @@ self.client.clone(dest=b('other')) other = hglib.open(b('other')) - self.assertEquals(self.client.log(), other.log()) - self.assertEquals(self.client.outgoing(path=b('other')), + self.assertEqual(self.client.log(), other.log()) + self.assertEqual(self.client.outgoing(path=b('other')), other.incoming()) self.append('a', 'a') rev, node = self.client.commit(b('third')) out = self.client.outgoing(path=b('other')) - self.assertEquals(len(out), 1) - self.assertEquals(out[0].node, node) + self.assertEqual(len(out), 1) + self.assertEqual(out[0].node, node) - self.assertEquals(out, other.incoming()) + self.assertEqual(out, other.incoming()) def test_bookmarks(self): self.append('a', 'a') @@ -46,8 +46,8 @@ self.client.bookmark(b('bm1'), 1) - self.assertEquals(other.incoming(bookmarks=True), + self.assertEqual(other.incoming(bookmarks=True), [(b('bm1'), self.client.tip().node[:12])]) - self.assertEquals(self.client.outgoing(path=b('other'), bookmarks=True), + self.assertEqual(self.client.outgoing(path=b('other'), bookmarks=True), [(b('bm1'), self.client.tip().node[:12])])