[Python-checkins] python/dist/src/Lib/test test_dummy_thread.py,1.4,1.5

bcannon@users.sourceforge.net bcannon@users.sourceforge.net
Fri, 13 Jun 2003 16:44:37 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv14872/Lib/test

Modified Files:
	test_dummy_thread.py 
Log Message:
dummy_thread modified to have interrupt_main and to behave appropriately when
called.

Added announcement in Misc/NEWS for thread.interrupt_main and mention of
dummy_thread's change.


Index: test_dummy_thread.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dummy_thread.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_dummy_thread.py	1 May 2003 17:45:36 -0000	1.4
--- test_dummy_thread.py	13 Jun 2003 23:44:35 -0000	1.5
***************
*** 103,106 ****
--- 103,114 ----
                           "returned by _thread.allocate_lock()")
  
+     def test_interrupt_main(self):
+         #Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+         def call_interrupt():
+             _thread.interrupt_main()
+         self.failUnlessRaises(KeyboardInterrupt, _thread.start_new_thread,
+                               call_interrupt, tuple())
+ 
  class ThreadTests(unittest.TestCase):
      """Test thread creation."""