From: Tim Peters Date: Mon, 22 Sep 2003 18:41:53 +0000 (+0000) Subject: PlaySoundTest.test_alias_nofallback(): Simplified the coding by using X-Git-Tag: v2.4a1~1534 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8b60ea0c97d8eea0fde6712b5c9848aa743b47c;p=python PlaySoundTest.test_alias_nofallback(): Simplified the coding by using assertRaises. NOT a bugfix candidate. --- diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index abe67274a8..d9d2892a6e 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -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(