Skip to content

Commit

Permalink
Use assertRegex instead of assertRegexpMatches for Python 3.11 compat…
Browse files Browse the repository at this point in the history
…ibility. (#508)

Signed-off-by: Karthikeyan Singaravelan <[email protected]>
  • Loading branch information
tirkarthi authored Oct 19, 2021
1 parent a1588df commit 4a44958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/h2o/test_h2o_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_h2o_unsupported_algo(self):
mojo_path, test_data = _train_classifier(gbm, 2, is_str=True)
with self.assertRaises(ValueError) as err:
_convert_mojo(mojo_path)
self.assertRegexpMatches(err.exception.args[0], "not supported")
self.assertRegex(err.exception.args[0], "not supported")

def test_h2o_regressor_unsupported_dists(self):
diabetes = load_diabetes()
Expand All @@ -169,7 +169,7 @@ def test_h2o_regressor_unsupported_dists(self):
mojo_path = _make_mojo(gbm, train)
with self.assertRaises(ValueError) as err:
_convert_mojo(mojo_path)
self.assertRegexpMatches(err.exception.args[0], "not supported")
self.assertRegex(err.exception.args[0], "not supported")

def test_h2o_regressor(self):
diabetes = load_diabetes()
Expand Down Expand Up @@ -202,7 +202,7 @@ def test_h2o_classifier_multi_2class(self):
mojo_path, test_data = _train_classifier(gbm, 2, is_str=True)
with self.assertRaises(ValueError) as err:
_convert_mojo(mojo_path)
self.assertRegexpMatches(err.exception.args[0], "not supported")
self.assertRegex(err.exception.args[0], "not supported")

def test_h2o_classifier_bin_cat(self):
y = "IsDepDelayed_REC"
Expand Down

0 comments on commit 4a44958

Please sign in to comment.