Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8b60ea

Browse files
committed
PlaySoundTest.test_alias_nofallback(): Simplified the coding by using
assertRaises. NOT a bugfix candidate.
1 parent 086e562 commit b8b60ea

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Lib/test/test_winsound.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,8 @@ def test_alias_fallback(self):
8585
return
8686

8787
def test_alias_nofallback(self):
88-
try:
89-
winsound.PlaySound(
90-
'!"$%&/(#+*',
91-
winsound.SND_ALIAS | winsound.SND_NODEFAULT
92-
)
93-
except RuntimeError:
94-
pass
88+
self.assertRaises(RuntimeError, winsound.PlaySound, '!"$%&/(#+*',
89+
winsound.SND_ALIAS | winsound.SND_NODEFAULT)
9590

9691
def test_stopasync(self):
9792
winsound.PlaySound(

0 commit comments

Comments
 (0)