From caf46b93291088be636a4e2a1fb641942c77fb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 14 Apr 2024 14:44:53 +0200 Subject: [PATCH] [Python3] Replace deprecated `assertEquals()` to fix py3.12 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the `assertEquals()` method calls in the Python3 test suite with the modern `assertEqual()`. The former was removed in Python 3.12, and therefore is causing the tests to fail. The latter is available in all versions of Python 3. Signed-off-by: Michał Górny --- runtime/Python3/tests/TestIntervalSet.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/Python3/tests/TestIntervalSet.py b/runtime/Python3/tests/TestIntervalSet.py index 6428c0d47c..1bd0ebe8c4 100644 --- a/runtime/Python3/tests/TestIntervalSet.py +++ b/runtime/Python3/tests/TestIntervalSet.py @@ -34,7 +34,7 @@ def testDistinct1(self): s = IntervalSet() s.addRange(range(30,32)) s.addRange(range(40,42)) - self.assertEquals(2,len(s.intervals)) + self.assertEqual(2,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(40 in s) self.assertFalse(35 in s) @@ -43,7 +43,7 @@ def testDistinct2(self): s = IntervalSet() s.addRange(range(40,42)) s.addRange(range(30,32)) - self.assertEquals(2,len(s.intervals)) + self.assertEqual(2,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(40 in s) self.assertFalse(35 in s) @@ -52,7 +52,7 @@ def testContiguous1(self): s = IntervalSet() s.addRange(range(30,36)) s.addRange(range(36,41)) - self.assertEquals(1,len(s.intervals)) + self.assertEqual(1,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(40 in s) self.assertTrue(35 in s) @@ -61,7 +61,7 @@ def testContiguous2(self): s = IntervalSet() s.addRange(range(36,41)) s.addRange(range(30,36)) - self.assertEquals(1,len(s.intervals)) + self.assertEqual(1,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(40 in s) @@ -69,7 +69,7 @@ def testOverlapping1(self): s = IntervalSet() s.addRange(range(30,40)) s.addRange(range(35,45)) - self.assertEquals(1,len(s.intervals)) + self.assertEqual(1,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(44 in s) @@ -77,7 +77,7 @@ def testOverlapping2(self): s = IntervalSet() s.addRange(range(35,45)) s.addRange(range(30,40)) - self.assertEquals(1,len(s.intervals)) + self.assertEqual(1,len(s.intervals)) self.assertTrue(30 in s) self.assertTrue(44 in s) @@ -87,7 +87,7 @@ def testOverlapping3(self): s.addRange(range(40,42)) s.addRange(range(50,52)) s.addRange(range(20,61)) - self.assertEquals(1,len(s.intervals)) + self.assertEqual(1,len(s.intervals)) self.assertTrue(20 in s) self.assertTrue(60 in s)