changeset 87645:63f3e8670fa6 3.3

Issue #19595: Re-enable a long-disabled test in test_winsound
author Zachary Ware <zachary.ware@gmail.com>
date Wed, 27 Nov 2013 23:56:04 -0600
parents 9d0dc3d7bf01
children b0e180f8e588 96d1207d33d0
files Lib/test/test_winsound.py Misc/NEWS
diffstat 2 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/test/test_winsound.py	Fri Nov 29 23:40:35 2013 +0200
+++ b/Lib/test/test_winsound.py	Wed Nov 27 23:56:04 2013 -0600
@@ -158,18 +158,14 @@
             )
 
     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():
--- a/Misc/NEWS	Fri Nov 29 23:40:35 2013 +0200
+++ b/Misc/NEWS	Wed Nov 27 23:56:04 2013 -0600
@@ -70,6 +70,8 @@
 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.