History

python/tests/test_musicutils.py: simplify, check TypeError is raised

Paul Brossier committed 10 years ago

Commit 98e41061 parent ff89a061 file · +2 −10Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/test_musicutils.py+2−10
@@ -15,20 +15,12 @@ class aubio_window(TestCase): · 14 unmodified lines
1515 window("default", 1024)
1616
1717 def test_fail_name_not_string(self):
18− try:
18+ with self.assertRaises(TypeError):
1919 window(10, 1024)
20− except ValueError as e:
21− pass
22− else:
23− self.fail('non-string window type does not raise a ValueError')
2420
2521 def test_fail_size_not_int(self):
26− try:
22+ with self.assertRaises(TypeError):
2723 window("default", "default")
28− except ValueError as e:
29− pass
30− else:
31− self.fail('non-integer window length does not raise a ValueError')
3224
3325 def test_compute_hanning_1024(self):
3426 size = 1024

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t