Skip to content

Commit

Permalink
[Python3] Replace deprecated assertEquals() to fix py3.12 compat
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mgorny authored and parrt committed Jul 25, 2024
1 parent 17f3f5e commit caf46b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runtime/Python3/tests/TestIntervalSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -61,23 +61,23 @@ 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)

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)

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)

Expand All @@ -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)

Expand Down

0 comments on commit caf46b9

Please sign in to comment.