Skip to content

Commit 4a44958

Browse files
authored
Use assertRegex instead of assertRegexpMatches for Python 3.11 compatibility. (#508)
Signed-off-by: Karthikeyan Singaravelan <[email protected]>
1 parent a1588df commit 4a44958

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/h2o/test_h2o_converters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_h2o_unsupported_algo(self):
158158
mojo_path, test_data = _train_classifier(gbm, 2, is_str=True)
159159
with self.assertRaises(ValueError) as err:
160160
_convert_mojo(mojo_path)
161-
self.assertRegexpMatches(err.exception.args[0], "not supported")
161+
self.assertRegex(err.exception.args[0], "not supported")
162162

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

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

207207
def test_h2o_classifier_bin_cat(self):
208208
y = "IsDepDelayed_REC"

0 commit comments

Comments
 (0)