Back to index

python3.2  3.2.2
Public Member Functions
test.test_capi.CAPITest Class Reference

List of all members.

Public Member Functions

def test_instancemethod
def test_no_FatalError_infinite_loop
def test_memoryview_from_NULL_pointer

Detailed Description

Definition at line 27 of file test_capi.py.


Member Function Documentation

Definition at line 29 of file test_capi.py.

00029 
00030     def test_instancemethod(self):
00031         inst = InstanceMethod()
00032         self.assertEqual(id(inst), inst.id())
00033         self.assertTrue(inst.testfunction() is inst)
00034         self.assertEqual(inst.testfunction.__doc__, testfunction.__doc__)
00035         self.assertEqual(InstanceMethod.testfunction.__doc__, testfunction.__doc__)
00036 
00037         InstanceMethod.testfunction.attribute = "test"
00038         self.assertEqual(testfunction.attribute, "test")
00039         self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test")

Here is the call graph for this function:

Definition at line 54 of file test_capi.py.

00054 
00055     def test_memoryview_from_NULL_pointer(self):
00056         self.assertRaises(ValueError, _testcapi.make_memoryview_from_NULL_pointer)
00057 
@unittest.skipUnless(threading, 'Threading required for this test.')

Here is the call graph for this function:

Definition at line 41 of file test_capi.py.

00041 
00042     def test_no_FatalError_infinite_loop(self):
00043         p = subprocess.Popen([sys.executable, "-c",
00044                               'import _testcapi;'
00045                               '_testcapi.crash_no_current_thread()'],
00046                              stdout=subprocess.PIPE,
00047                              stderr=subprocess.PIPE)
00048         (out, err) = p.communicate()
00049         self.assertEqual(out, b'')
00050         # This used to cause an infinite loop.
00051         self.assertEqual(err.rstrip(),
00052                          b'Fatal Python error:'
00053                          b' PyThreadState_Get: no current thread')

Here is the call graph for this function:


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