From: Paul Brossier Date: Fri, 21 Dec 2018 15:22:27 +0000 (+0100) Subject: [tests] check reading source after close raises RuntimeError X-Git-Tag: 0.4.9~32 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=87971384c0c84945758c285001a5bd21bae2c171 [tests] check reading source after close raises RuntimeError --- diff --git a/python/tests/test_source.py b/python/tests/test_source.py index 6d88c626..9d2e61fd 100755 --- a/python/tests/test_source.py +++ b/python/tests/test_source.py @@ -40,6 +40,19 @@ class Test_aubio_source_test_case(object): f.close() f.close() + @parametrize('filename', [default_test_sound]) + def test_read_after_close(self, filename): + samplerate = 0 # use native samplerate + hop_size = 256 + f = source(filename, samplerate, hop_size) + read, frames = f() + f.close() + with assert_raises(RuntimeError): + read, frames = f() + with assert_raises(RuntimeError): + read, frames = f.do_multi() + + class Test_aubio_source_read(object): def read_from_source(self, f):