From: Paul Brossier Date: Fri, 31 Jan 2014 21:19:05 +0000 (-0300) Subject: python/tests/test_source.py: improve exception checks X-Git-Tag: 0.4.1~59 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=c76345ee87f5f55ea5a1f4622595517ce2db4396;p=aubio.git python/tests/test_source.py: improve exception checks --- 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: