Back to index

python3.2  3.2.2
Public Member Functions
test.test_threading.ThreadingExceptionTests Class Reference
Inheritance diagram for test.test_threading.ThreadingExceptionTests:
Inheritance graph
[legend]
Collaboration diagram for test.test_threading.ThreadingExceptionTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_start_thread_again
def test_joining_current_thread
def test_joining_inactive_thread
def test_daemonize_active_thread
def test_recursion_limit
def setUp
def tearDown

Detailed Description

Definition at line 670 of file test_threading.py.


Member Function Documentation

def test.test_threading.BaseTestCase.setUp (   self) [inherited]

Definition at line 64 of file test_threading.py.

Here is the caller graph for this function:

def test.test_threading.BaseTestCase.tearDown (   self) [inherited]

Definition at line 67 of file test_threading.py.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 686 of file test_threading.py.

00686 
00687     def test_daemonize_active_thread(self):
00688         thread = threading.Thread()
00689         thread.start()
00690         self.assertRaises(RuntimeError, setattr, thread, "daemon", True)

Here is the call graph for this function:

Definition at line 678 of file test_threading.py.

00678 
00679     def test_joining_current_thread(self):
00680         current_thread = threading.current_thread()
00681         self.assertRaises(RuntimeError, current_thread.join);

Here is the call graph for this function:

Definition at line 682 of file test_threading.py.

00682 
00683     def test_joining_inactive_thread(self):
00684         thread = threading.Thread()
00685         self.assertRaises(RuntimeError, thread.join)

Here is the call graph for this function:

Definition at line 692 of file test_threading.py.

00692 
00693     def test_recursion_limit(self):
00694         # Issue 9670
00695         # test that excessive recursion within a non-main thread causes
00696         # an exception rather than crashing the interpreter on platforms
00697         # like Mac OS X or FreeBSD which have small default stack sizes
00698         # for threads
00699         script = """if True:
00700             import threading
00701 
00702             def recurse():
00703                 return recurse()
00704 
00705             def outer():
00706                 try:
00707                     recurse()
00708                 except RuntimeError:
00709                     pass
00710 
00711             w = threading.Thread(target=outer)
00712             w.start()
00713             w.join()
00714             print('end of main thread')
00715             """
00716         expected_output = "end of main thread\n"
00717         p = subprocess.Popen([sys.executable, "-c", script],
00718                              stdout=subprocess.PIPE)
00719         stdout, stderr = p.communicate()
00720         data = stdout.decode().replace('\r', '')
00721         self.assertEqual(p.returncode, 0, "Unexpected error")
00722         self.assertEqual(data, expected_output)

Here is the call graph for this function:

Definition at line 673 of file test_threading.py.

00673 
00674     def test_start_thread_again(self):
00675         thread = threading.Thread()
00676         thread.start()
00677         self.assertRaises(RuntimeError, thread.start)

Here is the call graph for this function:


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