Skip to content

Commit

Permalink
blacking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Mar 21, 2024
1 parent 4878992 commit 6589a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/test_melody.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_to_cent_voicing():


# We can ignore this warning, which occurs when testing with all-zeros reward
@pytest.mark.filterwarnings("ignore:Reference melody has no voiced frames")
@pytest.mark.filterwarnings("ignore:Reference melody has no voiced frames")
def test_continuous_voicing_metrics():
ref_time = np.array([0.0, 0.1, 0.2, 0.3])
ref_freq = np.array([440.0, 0.0, 220.0, 220.0])
Expand Down Expand Up @@ -335,6 +335,7 @@ def test_continuous_voicing_metrics():
for metric in actual_scores:
assert np.isclose(actual_scores[metric], expected_scores[metric])


def test_voicing_measures_empty():
# We need a special test for voicing_measures because it only takes 2 args
with pytest.warns() as w:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def test_segment_boundary_deviation_perfect():
)
def test_segment_structure_empty(metric):
with pytest.warns(UserWarning, match="Reference intervals are empty"):
metric(np.zeros((0, 2)), [], np.array([[0, 1]]), ['foo'])
metric(np.zeros((0, 2)), [], np.array([[0, 1]]), ["foo"])

with pytest.warns(UserWarning, match="Estimated intervals are empty"):
metric(np.array([[0, 1]]), ['foo'], np.zeros((0, 2)), [])
metric(np.array([[0, 1]]), ["foo"], np.zeros((0, 2)), [])

with pytest.warns(UserWarning, match="intervals are empty"):
empty_intervals = np.zeros((0, 2))
Expand Down

0 comments on commit 6589a98

Please sign in to comment.