]> granicus.if.org Git - python/commitdiff
PlaySoundTest.test_alias_nofallback(): Simplified the coding by using
authorTim Peters <tim.peters@gmail.com>
Mon, 22 Sep 2003 18:41:53 +0000 (18:41 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 22 Sep 2003 18:41:53 +0000 (18:41 +0000)
assertRaises.

NOT a bugfix candidate.

Lib/test/test_winsound.py

index abe67274a85b4575ca56f93561969e9e55b51aaa..d9d2892a6ebb58fe58c8ad09b08ee4e9d83307df 100644 (file)
@@ -85,13 +85,8 @@ class PlaySoundTest(unittest.TestCase):
         return
 
     def test_alias_nofallback(self):
-        try:
-            winsound.PlaySound(
-                '!"$%&/(#+*',
-                winsound.SND_ALIAS | winsound.SND_NODEFAULT
-            )
-        except RuntimeError:
-            pass
+        self.assertRaises(RuntimeError, winsound.PlaySound, '!"$%&/(#+*',
+                          winsound.SND_ALIAS | winsound.SND_NODEFAULT)
 
     def test_stopasync(self):
         winsound.PlaySound(