1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

pytests: heed assertEquals deprecation warning en-masse

TestCase.assertEquals() is an alias for TestCase.assertEqual() and
has been deprecated since Python 2.7.

When we run our tests with in python developer mode (`PYTHONDEVMODE=1
make test`) we get 580 DeprecationWarnings about this.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Douglas Bagnall
2020-02-07 11:02:38 +13:00
committed by Noel Power
parent 3bc7acc626
commit c247afbda0
129 changed files with 3795 additions and 3795 deletions

View File

@ -230,7 +230,7 @@ class BaseSortTests(samba.tests.TestCase):
print("unnormalised:", [x[attr][0] for x in res])
print("unnormalised: «%s»" % '» «'.join(str(x[attr][0])
for x in res))
self.assertEquals(expected_order, received_order)
self.assertEqual(expected_order, received_order)
def _test_server_sort_binary(self):
for attr in self.binary_sorted_keys:
@ -247,7 +247,7 @@ class BaseSortTests(samba.tests.TestCase):
print(attr)
print(expected_order)
print(received_order)
self.assertEquals(expected_order, received_order)
self.assertEqual(expected_order, received_order)
def _test_server_sort_us_english(self):
# Windows doesn't support many matching rules, but does allow
@ -278,7 +278,7 @@ class BaseSortTests(samba.tests.TestCase):
print("unnormalised: «%s»" % '» «'.join(str(x[attr][0])
for x in res))
self.assertEquals(expected_order, received_order)
self.assertEqual(expected_order, received_order)
def _test_server_sort_different_attr(self):
@ -337,7 +337,7 @@ class BaseSortTests(samba.tests.TestCase):
print("Try with --elements=27 (or similar).")
print('-' * 72)
self.assertEquals(expected_order, received_order)
self.assertEqual(expected_order, received_order)
for x in res:
if sort_attr in x:
self.fail('the search for %s should not return %s' %