History

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

Paul Brossier committed 10 years ago

Commit 15a005d1 parent 85e0e761 file · +4 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/test_source.py+4−1
@@ -7,7 +7,7 @@ from utils import list_all_sounds · 6 unmodified lines
7from nose2.tools import params7from nose2.tools import params
8 8
9list_of_sounds = list_all_sounds('sounds')9list_of_sounds = list_all_sounds('sounds')
10default_test_sound = list_of_sounds[0]10default_test_sound = None
11samplerates = [0, 44100, 8000, 32000]11samplerates = [0, 44100, 8000, 32000]
12hop_sizes = [512, 1024, 64]12hop_sizes = [512, 1024, 64]
13 13
@@ -24,6 +24,7 @@ class aubio_source_test_case_base(TestCase): · 10 unmodified lines
24 24
25 def setUp(self):25 def setUp(self):
26 if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'')26 if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'')
27 default_test_sound = list_of_sounds[0]
27 28
28class aubio_source_test_case(aubio_source_test_case_base):29class aubio_source_test_case(aubio_source_test_case_base):
29 30
@@ -113,6 +114,8 @@ class aubio_source_test_wrong_params(TestCase): · 83 unmodified lines
113 with self.assertRaises(RuntimeError):114 with self.assertRaises(RuntimeError):
114 f = source('path_to/unexisting file.mp3')115 f = source('path_to/unexisting file.mp3')
115 116
117class aubio_source_test_wrong_params(aubio_source_test_case_base):
118
116 def test_wrong_samplerate(self):119 def test_wrong_samplerate(self):
117 with self.assertRaises(ValueError):120 with self.assertRaises(ValueError):
118 f = source(default_test_sound, -1)121 f = source(default_test_sound, -1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t