summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_winsound.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index 2759787..069adc3 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -158,14 +158,15 @@ class PlaySoundTest(unittest.TestCase):
)
def test_alias_fallback(self):
- if _have_soundcard():
+ # In the absense of the ability to tell if a sound was actually
+ # played, this test has two acceptable outcomes: success (no error,
+ # sound was theoretically played; although as issue #19987 shows
+ # a box without a soundcard can "succeed") or RuntimeError. Any
+ # other error is a failure.
+ try:
winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS)
- else:
- self.assertRaises(
- RuntimeError,
- winsound.PlaySound,
- '!"$%&/(#+*', winsound.SND_ALIAS
- )
+ except RuntimeError:
+ pass
def test_alias_nofallback(self):
if _have_soundcard():