]> granicus.if.org Git - python/commitdiff
test_winsound: new try to skip the tests. In Python 2.6, TestSkipped is used to
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 19 Apr 2010 15:18:07 +0000 (15:18 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 19 Apr 2010 15:18:07 +0000 (15:18 +0000)
skip the whole file, not a particular function.

Lib/test/test_winsound.py

index 2d5614c12a7115e09f303f26c78a9a38b5924571..f76db58a50fa2c314b4ed01d384c28da68de31fd 100644 (file)
@@ -97,7 +97,8 @@ class PlaySoundTest(unittest.TestCase):
 
     def test_alias_asterisk(self):
         if not has_sound("SystemAsterisk"):
-            raise test_support.TestSkipped("No default SystemAsterisk")
+            print "No default SystemAsterisk"
+            return
         if _have_soundcard():
             winsound.PlaySound('SystemAsterisk', winsound.SND_ALIAS)
         else:
@@ -109,7 +110,8 @@ class PlaySoundTest(unittest.TestCase):
 
     def test_alias_exclamation(self):
         if not has_sound("SystemExclamation"):
-            raise test_support.TestSkipped("No default SystemExclamation")
+            print "No default SystemExclamation"
+            return
         if _have_soundcard():
             winsound.PlaySound('SystemExclamation', winsound.SND_ALIAS)
         else:
@@ -121,7 +123,8 @@ class PlaySoundTest(unittest.TestCase):
 
     def test_alias_exit(self):
         if not has_sound("SystemExit"):
-            raise test_support.TestSkipped("No default SystemExit")
+            print "No default SystemExit"
+            return
         if _have_soundcard():
             winsound.PlaySound('SystemExit', winsound.SND_ALIAS)
         else:
@@ -133,7 +136,8 @@ class PlaySoundTest(unittest.TestCase):
 
     def test_alias_hand(self):
         if not has_sound("SystemHand"):
-            raise test_support.TestSkipped("No default SystemHand")
+            print "No default SystemHand"
+            return
         if _have_soundcard():
             winsound.PlaySound('SystemHand', winsound.SND_ALIAS)
         else:
@@ -145,7 +149,8 @@ class PlaySoundTest(unittest.TestCase):
 
     def test_alias_question(self):
         if not has_sound("SystemQuestion"):
-            raise test_support.TestSkipped("No default SystemQuestion")
+            print "No default SystemQuestion"
+            return
         if _have_soundcard():
             winsound.PlaySound('SystemQuestion', winsound.SND_ALIAS)
         else: