Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -23,28 +23,29 @@ no_sounds_msg = "no test sounds, add some in 'python/tests/sounds/'!" · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | _debug = False |
| 25 | 25 | |
| 26 | −class Test_aubio_source_test_case(object): | |
| 26 | +class Test_aubio_source_test_case(TestCase): | |
| 27 | 27 | |
| 28 | − @parametrize('filename', list_of_sounds) | |
| 29 | − def test_close_file(self, filename): | |
| 28 | + def setUp(self): | |
| 29 | + if not default_test_sound: | |
| 30 | + skipTest(no_sounds_msg) | |
| 31 | + | |
| 32 | + def test_close_file(self): | |
| 30 | 33 | samplerate = 0 # use native samplerate |
| 31 | 34 | hop_size = 256 |
| 32 | − f = source(filename, samplerate, hop_size) | |
| 35 | + f = source(default_test_sound, samplerate, hop_size) | |
| 33 | 36 | f.close() |
| 34 | 37 | |
| 35 | − @parametrize('filename', list_of_sounds) | |
| 36 | − def test_close_file_twice(self, filename): | |
| 38 | + def test_close_file_twice(self): | |
| 37 | 39 | samplerate = 0 # use native samplerate |
| 38 | 40 | hop_size = 256 |
| 39 | − f = source(filename, samplerate, hop_size) | |
| 41 | + f = source(default_test_sound, samplerate, hop_size) | |
| 40 | 42 | f.close() |
| 41 | 43 | f.close() |
| 42 | 44 | |
| 43 | − @parametrize('filename', [default_test_sound]) | |
| 44 | − def test_read_after_close(self, filename): | |
| 45 | + def test_read_after_close(self): | |
| 45 | 46 | samplerate = 0 # use native samplerate |
| 46 | 47 | hop_size = 256 |
| 47 | − f = source(filename, samplerate, hop_size) | |
| 48 | + f = source(default_test_sound, samplerate, hop_size) | |
| 48 | 49 | read, frames = f() |
| 49 | 50 | f.close() |
| 50 | 51 | with assert_raises(RuntimeError): |