Skip to content

Commit

Permalink
catching more warnings in separation test
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Mar 21, 2024
1 parent d12b583 commit 4878992
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_separation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ def test_empty_input(metric):
args = [np.array([]), np.array([]), 40, 20]

with pytest.warns(UserWarning, match="estimated_sources is empty,"):
# First, test for a warning on empty audio data
metric(*args)
# And that the metric returns empty arrays
assert np.allclose(metric(*args), np.array([]))
with pytest.warns(UserWarning, match="reference_sources is empty,"):
# First, test for a warning on empty audio data
metric(*args)
# And that the metric returns empty arrays
assert np.allclose(metric(*args), np.array([]))


@pytest.mark.parametrize(
Expand Down

0 comments on commit 4878992

Please sign in to comment.