From 541c916f7fd2419cd17565d645b7621e47e0cfe6 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 28 Dec 2023 13:00:04 -0500 Subject: [PATCH] fix(tests): try not to test where no sox --- .github/workflows/tests.yml | 1 + cython/test/endpointer_test.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bc797745..8fb0559b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,7 @@ jobs: with: python-version: ${{ matrix.py }} - name: Install sox + if: ${{ matrix.os == "ubuntu-latest" }} run: sudo apt-get install sox - name: Install tox run: python -m pip install tox-gh>=1.2 diff --git a/cython/test/endpointer_test.py b/cython/test/endpointer_test.py index 8e09a4f92..18bee77c9 100644 --- a/cython/test/endpointer_test.py +++ b/cython/test/endpointer_test.py @@ -243,11 +243,14 @@ def srtest(self, sample_rate): idx += 1 def testEndpointer(self): - set_loglevel("INFO") - # 8000, 44100, 48000 give slightly different results unfortunately - for sample_rate in 11025, 16000, 22050, 32000: - print(sample_rate) - self.srtest(sample_rate) + try: + set_loglevel("INFO") + # 8000, 44100, 48000 give slightly different results unfortunately + for sample_rate in 11025, 16000, 22050, 32000: + print(sample_rate) + self.srtest(sample_rate) + except OSError as err: + self.skipTest("sox not installed: %s" % err) if __name__ == "__main__":