]> granicus.if.org Git - python/commitdiff
Issue #19595: Re-enable a long-disabled test in test_winsound
authorZachary Ware <zachary.ware@gmail.com>
Thu, 28 Nov 2013 05:56:04 +0000 (23:56 -0600)
committerZachary Ware <zachary.ware@gmail.com>
Thu, 28 Nov 2013 05:56:04 +0000 (23:56 -0600)
Lib/test/test_winsound.py
Misc/NEWS

index 7cdecd867085509a3810eb14fc6224015fac3037..6d8649abb914952210d9ba1a0ef333663dd43a36 100644 (file)
@@ -159,18 +159,14 @@ class PlaySoundTest(unittest.TestCase):
             )
 
     def test_alias_fallback(self):
-        # This test can't be expected to work on all systems.  The MS
-        # PlaySound() docs say:
-        #
-        #     If it cannot find the specified sound, PlaySound uses the
-        #     default system event sound entry instead.  If the function
-        #     can find neither the system default entry nor the default
-        #     sound, it makes no sound and returns FALSE.
-        #
-        # It's known to return FALSE on some real systems.
-
-        # winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS)
-        return
+        if _have_soundcard():
+            winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS)
+        else:
+            self.assertRaises(
+                RuntimeError,
+                winsound.PlaySound,
+                '!"$%&/(#+*', winsound.SND_ALIAS
+            )
 
     def test_alias_nofallback(self):
         if _have_soundcard():
index 970dca45d21df776b9bc1a80a2b2c21f850137e3..e894f3e408fc3c7bce20d362c2742047174c89bf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -53,6 +53,8 @@ Library
 Tests
 -----
 
+- Issue #19595: Re-enabled a long-disabled test in test_winsound.
+
 - Issue #19588: Fixed tests in test_random that were silently skipped most
   of the time.  Patch by Julian Gindi.