From 87971384c0c84945758c285001a5bd21bae2c171 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 21 Dec 2018 16:22:27 +0100 Subject: [PATCH 1/1] [tests] check reading source after close raises RuntimeError --- python/tests/test_source.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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): -- 2.11.0