Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jul 4, 2024
1 parent aa87c89 commit 5398bd0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ pytest
pytest-cov
pytest-doctestplus
scipy
sox
27 changes: 27 additions & 0 deletions tests/test_transform_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
auglib.seed(0)


def sox_transform(
signal: np.array,
sampling_rate: int,
):
import sox

tfm = sox.Transformer()
tfm.pitch(2)
signal_augmented = tfm.build_array(
input_array=signal.squeeze(),
sample_rate_in=sampling_rate,
)
return signal_augmented


@pytest.mark.parametrize("signal", [[1, 1]])
@pytest.mark.parametrize("sampling_rate", [8000])
@pytest.mark.parametrize(
Expand All @@ -26,6 +41,18 @@
],
[2, 1, 1, 0],
),
(
# Include transform that returns a read-only arrary
# https://github.com/audeering/auglib/issues/31
[
auglib.transform.Function(sox_transform),
auglib.transform.WhiteNoiseGaussian(snr_db=20),
],
[2, 1, 1, 0],
),
# Affected transforms:
# Mix
# Tone
],
)
def test_compose(
Expand Down

0 comments on commit 5398bd0

Please sign in to comment.