From 03455bc577a439c6280d86c694769341237d506d Mon Sep 17 00:00:00 2001 From: vrey Date: Fri, 6 Jan 2023 20:15:02 +0100 Subject: [PATCH] Update `MetricTracker`'s tests (#1428) * Add test case to `test_raises_error_on_wrong_input` to check that the initialization of a MetricTracker with a single `metric` and a list `maximize` raises a ValueError --- tests/unittests/wrappers/test_tracker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unittests/wrappers/test_tracker.py b/tests/unittests/wrappers/test_tracker.py index a2981d2d126..9485cf0e276 100644 --- a/tests/unittests/wrappers/test_tracker.py +++ b/tests/unittests/wrappers/test_tracker.py @@ -41,6 +41,11 @@ def test_raises_error_on_wrong_input(): ): MetricTracker(MetricCollection([MeanAbsoluteError(), MeanSquaredError()]), maximize=[False, False, False]) + with pytest.raises( + ValueError, match="Argument `maximize` should be a single bool when `metric` is a single Metric" + ): + MetricTracker(MeanAbsoluteError(), maximize=[False]) + @pytest.mark.parametrize( "method, method_input",