diff options
author | Brett Cannon <bcannon@gmail.com> | 2003-06-13 23:44:35 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2003-06-13 23:44:35 (GMT) |
commit | 4e64d78bbb961672ee324db234c70320ed4db6d5 (patch) | |
tree | c5aa27b4e8b98693b93bfdf01e42ea1ac007c608 /Lib/test/test_dummy_thread.py | |
parent | 93e8e5492402d55e0c0c4b08ff213783f5891561 (diff) | |
download | cpython-4e64d78bbb961672ee324db234c70320ed4db6d5.zip cpython-4e64d78bbb961672ee324db234c70320ed4db6d5.tar.gz cpython-4e64d78bbb961672ee324db234c70320ed4db6d5.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_dummy_thread.py')
-rw-r--r-- | Lib/test/test_dummy_thread.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py index 0d614e1..d437cb1 100644 --- a/Lib/test/test_dummy_thread.py +++ b/Lib/test/test_dummy_thread.py @@ -102,6 +102,14 @@ class MiscTests(unittest.TestCase): "_thread.LockType is not an instance of what is " "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.""" |