shithub: aubio

Download patch

ref: 15a005d60b4720b823fdd906b1648b84f7eaf770
parent: 85e0e764df9f6d522103fa40c0b68316dae4d769
author: Paul Brossier <piem@piem.org>
date: Sun May 15 17:25:13 EDT 2016

python/tests/test_source.py: skip tests if no sounds were found

--- a/python/tests/test_source.py
+++ b/python/tests/test_source.py
@@ -7,7 +7,7 @@
 from nose2.tools import params
 
 list_of_sounds = list_all_sounds('sounds')
-default_test_sound = list_of_sounds[0]
+default_test_sound = None
 samplerates = [0, 44100, 8000, 32000]
 hop_sizes = [512, 1024, 64]
 
@@ -24,6 +24,7 @@
 
     def setUp(self):
         if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'')
+        default_test_sound = list_of_sounds[0]
 
 class aubio_source_test_case(aubio_source_test_case_base):
 
@@ -112,6 +113,8 @@
     def test_wrong_file(self):
         with self.assertRaises(RuntimeError):
             f = source('path_to/unexisting file.mp3')
+
+class aubio_source_test_wrong_params(aubio_source_test_case_base):
 
     def test_wrong_samplerate(self):
         with self.assertRaises(ValueError):