From c76345ee87f5f55ea5a1f4622595517ce2db4396 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 31 Jan 2014 18:19:05 -0300 Subject: [PATCH] python/tests/test_source.py: improve exception checks --- python/tests/test_source.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/tests/test_source.py b/python/tests/test_source.py index 86607be4..b3277799 100755 --- a/python/tests/test_source.py +++ b/python/tests/test_source.py @@ -47,19 +47,19 @@ class aubio_source_test_case(TestCase): for p in list_of_sounds: try: f = source(p, -1) - except Exception, e: - print e + except ValueError, e: + pass else: - self.fail('does not fail with wrong samplerate') + self.fail('negative samplerate does not raise ValueError') def test_wrong_hop_size(self): for p in list_of_sounds: try: f = source(p, 0, -1) - except Exception, e: - print e + except ValueError, e: + pass else: - self.fail('does not fail with wrong hop_size %d' % f.hop_size) + self.fail('negative hop_size does not raise ValueError') def test_zero_hop_size(self): for p in list_of_sounds: -- 2.11.0