Skip to content

Commit

Permalink
TST: add tests for MacOS (#3)
Browse files Browse the repository at this point in the history
* TST: add tests for MacOS

* Adjust pink noise test
  • Loading branch information
hagenw authored Jan 17, 2024
1 parent 7a5e244 commit 4d4f202
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ ubuntu-latest, macOS-latest ]
python-version: [ '3.10' ]
include:
- os: ubuntu-latest
Expand All @@ -36,12 +36,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Ubuntu - install libsndfile
- name: Ubuntu - install audio packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --yes libsndfile1 ffmpeg sox libavcodec-extra
if: matrix.os == 'ubuntu-latest'

- name: OSX - install audio packages
run: brew install ffmpeg mediainfo
if: matrix.os == 'macOS-latest'

- name: Install package
run: |
python -m pip install --upgrade pip
Expand Down
8 changes: 3 additions & 5 deletions tests/test_transform_pink_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ def test_pink_noise(duration, sampling_rate, gain_db, snr_db):
expected_volume,
decimal=1,
)
np.testing.assert_array_equal(
noise,
expected_noise,
strict=True,
)
assert noise.shape == expected_noise.shape
assert noise.dtype == expected_noise.dtype
np.testing.assert_almost_equal(noise, expected_noise)

0 comments on commit 4d4f202

Please sign in to comment.