[Python-checkins] python/dist/src/Lib/test test_winsound.py, 1.8, 1.9

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun May 16 01:36:33 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3404/Lib/test

Modified Files:
	test_winsound.py 
Log Message:
test_alias_nofallback():  Someone broke this test, after 2.3, by
converting it into assertRaises() form.  Restored the 2.3 code, and
explained why assertRaises() cannot be used instead.


Index: test_winsound.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_winsound.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** test_winsound.py	22 Sep 2003 18:41:53 -0000	1.8
--- test_winsound.py	16 May 2004 05:36:30 -0000	1.9
***************
*** 86,91 ****
  
      def test_alias_nofallback(self):
!         self.assertRaises(RuntimeError, winsound.PlaySound, '!"$%&/(#+*',
!                           winsound.SND_ALIAS | winsound.SND_NODEFAULT)
  
      def test_stopasync(self):
--- 86,107 ----
  
      def test_alias_nofallback(self):
!         # Note that this is not the same as asserting RuntimeError
!         # will get raised:  you cannot convert this to
!         # self.assertRaises(...) form.  The attempt may or may not
!         # raise RuntimeError, but it shouldn't raise anything other
!         # than RuntimeError, and that's all we're trying to test here.
!         # The MS docs aren't clear about whether the SDK PlaySound()
!         # with SND_ALIAS and SND_NODEFAULT will return True or False when
!         # the alias is unknown.  On Tim's WinXP box today, it returns
!         # True (no exception is raised).  What we'd really like to test
!         # is that no sound is played, but that requires first wiring an
!         # eardrum class into unittest <wink>.
!         try:
!             winsound.PlaySound(
!                 '!"$%&/(#+*',
!                 winsound.SND_ALIAS | winsound.SND_NODEFAULT
!             )
!         except RuntimeError:
!             pass
  
      def test_stopasync(self):




More information about the Python-checkins mailing list