Fix tests in python 3.13

This commit is contained in:
2024-12-16 01:27:34 +01:00
parent 419c899c94
commit 69e21584bd
3 changed files with 6 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ class ArgumentsTest(TestBase):
test_args = ["-n", "3", "-k", "date"]
with self.assertRaises(SystemExit):
arguments.parse(test_args)
self.assertRegexpMatches(
self.assertRegex(
stderr.getvalue(),
r"error: the following arguments are required: -m/--model",
)
@@ -79,7 +79,7 @@ class ArgumentsTest(TestBase):
test_args = ["-n", "3", "-m", "SVC"]
with self.assertRaises(SystemExit):
arguments.parse(test_args)
self.assertRegexpMatches(
self.assertRegex(
stderr.getvalue(),
r"error: the following arguments are required: -k/--key",
)
@@ -114,7 +114,7 @@ class ArgumentsTest(TestBase):
test_args = None
with self.assertRaises(SystemExit):
arguments.parse(test_args)
self.assertRegexpMatches(
self.assertRegex(
stderr.getvalue(),
r"error: the following arguments are required: -m/--model, "
"-k/--key, --title",

View File

@@ -6,7 +6,7 @@
"kernel": "liblinear",
"multiclass_strategy": "ovr"
},
"v. 1.3.1, Computed on Test on 2022-02-22 at 12:00:00 took 1s"
"v. 1.4.0, Computed on Test on 2022-02-22 at 12:00:00 took 1s"
],
"balloons": [
0.625,
@@ -15,6 +15,6 @@
"kernel": "linear",
"multiclass_strategy": "ovr"
},
"v. 1.3.1, Computed on Test on 2022-02-22 at 12:00:00 took 1s"
"v. 1.4.0, Computed on Test on 2022-02-22 at 12:00:00 took 1s"
]
}

View File

@@ -120,7 +120,7 @@ class BeMainTest(TestBase):
module.main(parameter)
self.assertEqual(msg.exception.code, 2)
self.assertEqual(stderr.getvalue(), "")
self.assertRegexpMatches(stdout.getvalue(), message)
self.assertRegex(stdout.getvalue(), message)
def test_be_main_best_params_non_existent(self):
model = "GBC"