Skip to content

Commit 10809ba

Browse files
committed
feat: add unit test for exception in pattern_based_weighted_mean_metric
1 parent bb82d3c commit 10809ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/benchmark/test_metrics.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,13 @@ def test_distance_correlation_complement(
352352
def test_pattern_based_weighted_mean_metric(
353353
df1: pd.DataFrame, df2: pd.DataFrame, df_mask: pd.DataFrame
354354
) -> None:
355+
with pytest.raises(Exception):
356+
metrics.pattern_based_weighted_mean_metric(
357+
df1, df2, df_mask, metric=metrics.distance_correlation_complement, min_num_row=5
358+
)
355359

360+
expected = pd.Series([2 / 3], index=["All"])
356361
result = metrics.pattern_based_weighted_mean_metric(
357-
df1, df2, df_mask, metric=metrics.distance_correlation_complement, min_num_row=5
362+
df1, df2, df_mask, metric=metrics.distance_correlation_complement, min_num_row=1
358363
)
359-
expected = pd.Series([2 / 3], index=["All"])
360364
np.testing.assert_allclose(result, expected, atol=1e-3)

0 commit comments

Comments
 (0)