diff --git a/tests/safeds/data/tabular/transformation/test_imputer.py b/tests/safeds/data/tabular/transformation/test_imputer.py index 4366894b2..72426f34f 100644 --- a/tests/safeds/data/tabular/transformation/test_imputer.py +++ b/tests/safeds/data/tabular/transformation/test_imputer.py @@ -291,12 +291,15 @@ def test_should_return_transformed_table( strategy: ImputerStrategy, expected: Table, ) -> None: - with warnings.catch_warnings(): - warnings.filterwarnings( - action="ignore", - message=r"There are multiple most frequent values in a column given to the Imputer\..*", - category=UserWarning, - ) + if isinstance(strategy, Imputer.Strategy.Mode): + with warnings.catch_warnings(): + warnings.filterwarnings( + action="ignore", + message=r"There are multiple most frequent values in a column given to the Imputer\..*", + category=UserWarning, + ) + assert Imputer(strategy).fit_and_transform(table, column_names) == expected + else: assert Imputer(strategy).fit_and_transform(table, column_names) == expected @pytest.mark.parametrize("strategy", strategies(), ids=lambda x: x.__class__.__name__)