From d71a2521e51b3342b32698850ba5bb2e02ae1c99 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Fri, 21 Apr 2023 23:28:56 +0000 Subject: [PATCH] test for invalid model --- tests/trainers/test_regression.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/trainers/test_regression.py b/tests/trainers/test_regression.py index 75835bcac02..22bc5abd3d4 100644 --- a/tests/trainers/test_regression.py +++ b/tests/trainers/test_regression.py @@ -286,6 +286,12 @@ def test_trainer( except MisconfigurationException: pass + def test_invalid_model(self, model_kwargs: dict[str, Any]) -> None: + model_kwargs["model"] = "invalid_model" + match = "Model type 'invalid_model' is not valid." + with pytest.raises(ValueError, match=match): + PixelwiseRegressionTask(**model_kwargs) + @pytest.fixture def model_kwargs(self) -> dict[str, Any]: return {