From b8b60ea0c97d8eea0fde6712b5c9848aa743b47c Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 22 Sep 2003 18:41:53 +0000 Subject: [PATCH] PlaySoundTest.test_alias_nofallback(): Simplified the coding by using assertRaises. NOT a bugfix candidate. --- Lib/test/test_winsound.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index abe67274a85..d9d2892a6eb 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(