From: Paul Brossier Date: Fri, 13 May 2016 15:54:49 +0000 (+0200) Subject: python/tests/test_musicutils.py: simplify, check TypeError is raised X-Git-Tag: 0.4.4~300^2~55 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=98e41065ab6e7250d77892c47f425895172de516 python/tests/test_musicutils.py: simplify, check TypeError is raised --- diff --git a/python/tests/test_musicutils.py b/python/tests/test_musicutils.py index 8c96c948..c0c81dc4 100755 --- a/python/tests/test_musicutils.py +++ b/python/tests/test_musicutils.py @@ -15,20 +15,12 @@ class aubio_window(TestCase): window("default", 1024) def test_fail_name_not_string(self): - try: + with self.assertRaises(TypeError): window(10, 1024) - except ValueError as e: - pass - else: - self.fail('non-string window type does not raise a ValueError') def test_fail_size_not_int(self): - try: + with self.assertRaises(TypeError): window("default", "default") - except ValueError as e: - pass - else: - self.fail('non-integer window length does not raise a ValueError') def test_compute_hanning_1024(self): size = 1024