Changeset 6dc211b


Ignore:
Timestamp:
Dec 21, 2018, 4:39:56 PM (11 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/timestretch, master
Children:
fc633f3
Parents:
6200052
Message:

[tests] simplify test_source.py, skip if no test sounds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_source.py

    r6200052 r6dc211b  
    2424_debug = False
    2525
    26 class Test_aubio_source_test_case(object):
    27 
    28     @parametrize('filename', list_of_sounds)
    29     def test_close_file(self, filename):
     26class Test_aubio_source_test_case(TestCase):
     27
     28    def setUp(self):
     29        if not default_test_sound:
     30            skipTest(no_sounds_msg)
     31
     32    def test_close_file(self):
    3033        samplerate = 0 # use native samplerate
    3134        hop_size = 256
    32         f = source(filename, samplerate, hop_size)
    33         f.close()
    34 
    35     @parametrize('filename', list_of_sounds)
    36     def test_close_file_twice(self, filename):
     35        f = source(default_test_sound, samplerate, hop_size)
     36        f.close()
     37
     38    def test_close_file_twice(self):
    3739        samplerate = 0 # use native samplerate
    3840        hop_size = 256
    39         f = source(filename, samplerate, hop_size)
    40         f.close()
    41         f.close()
    42 
    43     @parametrize('filename', [default_test_sound])
    44     def test_read_after_close(self, filename):
     41        f = source(default_test_sound, samplerate, hop_size)
     42        f.close()
     43        f.close()
     44
     45    def test_read_after_close(self):
    4546        samplerate = 0 # use native samplerate
    4647        hop_size = 256
    47         f = source(filename, samplerate, hop_size)
     48        f = source(default_test_sound, samplerate, hop_size)
    4849        read, frames = f()
    4950        f.close()
Note: See TracChangeset for help on using the changeset viewer.