Skip to content

Commit

Permalink
Merge pull request #16 from tirkarthi/fix-assert
Browse files Browse the repository at this point in the history
Refactor deprecated unittest aliases for Python 3.11 compatibility.
  • Loading branch information
davidsaxton authored Nov 1, 2021
2 parents e91dba6 + 87b86f0 commit 900a081
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mathematics_dataset/util/composition_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def testSplit(self):
class EntityTest(absltest.TestCase):

def testInit_valueErrorIfSelfAndHandle(self):
with self.assertRaisesRegexp(ValueError, 'Cannot specify handle'):
with self.assertRaisesRegex(self, ValueError, 'Cannot specify handle'):
composition.Entity(context=composition.Context(),
value=0,
description='Something with {self}. ',
Expand Down
4 changes: 2 additions & 2 deletions mathematics_dataset/util/display_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def testInt(self):

def testInt_errorIfNonInt(self):
decimal = display.Decimal(sympy.Rational(1, 2))
with self.assertRaisesRegexp(TypeError, 'Cannot represent'):
with self.assertRaisesRegex(self, TypeError, 'Cannot represent'):
int(decimal)

def testComparison(self):
Expand Down Expand Up @@ -175,7 +175,7 @@ def testBasic(self):
self.assertEqual(str(ordinal), 'tenth')

def testCreate_errorIfNegative(self):
with self.assertRaisesRegexp(ValueError, 'Unsupported ordinal'):
with self.assertRaisesRegex(self, ValueError, 'Unsupported ordinal'):
display.StringOrdinal(-1)


Expand Down

0 comments on commit 900a081

Please sign in to comment.