ref: 98e41065ab6e7250d77892c47f425895172de516
parent: ff89a067d9cebe3de5c3d5fb57085e42feb6142f
author: Paul Brossier <piem@piem.org>
date: Fri May 13 13:54:49 EDT 2016
python/tests/test_musicutils.py: simplify, check TypeError is raised
--- a/python/tests/test_musicutils.py
+++ b/python/tests/test_musicutils.py
@@ -15,20 +15,12 @@
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