Back to index

python3.2  3.2.2
Public Member Functions
test.test_dummy_thread.MiscTests Class Reference

List of all members.

Public Member Functions

def test_exit
def test_ident
def test_LockType
def test_interrupt_main
def test_interrupt_in_main

Detailed Description

Miscellaneous tests.

Definition at line 86 of file test_dummy_thread.py.


Member Function Documentation

Definition at line 89 of file test_dummy_thread.py.

00089 
00090     def test_exit(self):
00091         #Make sure _thread.exit() raises SystemExit
00092         self.assertRaises(SystemExit, _thread.exit)

Here is the call graph for this function:

Definition at line 93 of file test_dummy_thread.py.

00093 
00094     def test_ident(self):
00095         #Test sanity of _thread.get_ident()
00096         self.assertIsInstance(_thread.get_ident(), int,
00097                               "_thread.get_ident() returned a non-integer")
00098         self.assertTrue(_thread.get_ident() != 0,
00099                         "_thread.get_ident() returned 0")

Here is the call graph for this function:

Definition at line 114 of file test_dummy_thread.py.

00114 
00115     def test_interrupt_in_main(self):
00116         # Make sure that if interrupt_main is called in main threat that
00117         # KeyboardInterrupt is raised instantly.
00118         self.assertRaises(KeyboardInterrupt, _thread.interrupt_main)

Here is the call graph for this function:

Definition at line 106 of file test_dummy_thread.py.

00106 
00107     def test_interrupt_main(self):
00108         #Calling start_new_thread with a function that executes interrupt_main
00109         # should raise KeyboardInterrupt upon completion.
00110         def call_interrupt():
00111             _thread.interrupt_main()
00112         self.assertRaises(KeyboardInterrupt, _thread.start_new_thread,
00113                               call_interrupt, tuple())

Here is the call graph for this function:

Definition at line 100 of file test_dummy_thread.py.

00100 
00101     def test_LockType(self):
00102         #Make sure _thread.LockType is the same type as _thread.allocate_locke()
00103         self.assertIsInstance(_thread.allocate_lock(), _thread.LockType,
00104                               "_thread.LockType is not an instance of what "
00105                               "is returned by _thread.allocate_lock()")

Here is the call graph for this function:


The documentation for this class was generated from the following file: