Skip to content

Commit

Permalink
Update tests/safeds/data/tabular/transformation/test_imputer.py
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander <[email protected]>
  • Loading branch information
zzril and Marsmaennchen221 authored Jul 7, 2023
1 parent f5e4b80 commit 17ad3f5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/safeds/data/tabular/transformation/test_imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down

0 comments on commit 17ad3f5

Please sign in to comment.