Lines Matching refs:_testcapi
27 _testcapi = support.import_module('_testcapi') variable
41 id = _testcapi.instancemethod(id)
42 testfunction = _testcapi.instancemethod(testfunction)
76 self.assertRaises(ValueError, _testcapi.make_memoryview_from_NULL_pointer)
86 orig_exc_info = _testcapi.set_exc_info(new_exc.__class__, new_exc, None)
88 new_exc_info = _testcapi.set_exc_info(*orig_exc_info)
132 self.assertEqual(_testcapi.no_docstring.__doc__, None)
133 self.assertEqual(_testcapi.no_docstring.__text_signature__, None)
135 self.assertEqual(_testcapi.docstring_empty.__doc__, None)
136 self.assertEqual(_testcapi.docstring_empty.__text_signature__, None)
138 self.assertEqual(_testcapi.docstring_no_signature.__doc__,
140 self.assertEqual(_testcapi.docstring_no_signature.__text_signature__, None)
142 self.assertEqual(_testcapi.docstring_with_invalid_signature.__doc__,
147 self.assertEqual(_testcapi.docstring_with_invalid_signature.__text_signature__, None)
149 self.assertEqual(_testcapi.docstring_with_invalid_signature2.__doc__,
156 self.assertEqual(_testcapi.docstring_with_invalid_signature2.__text_signature__, None)
158 self.assertEqual(_testcapi.docstring_with_signature.__doc__,
160 self.assertEqual(_testcapi.docstring_with_signature.__text_signature__, "($module, /, sig)")
162 self.assertEqual(_testcapi.docstring_with_signature_but_no_doc.__doc__, None)
163 self.assertEqual(_testcapi.docstring_with_signature_but_no_doc.__text_signature__,
166 self.assertEqual(_testcapi.docstring_with_signature_and_extra_newlines.__doc__,
168 self.assertEqual(_testcapi.docstring_with_signature_and_extra_newlines.__text_signature__,
172 M = _testcapi.matmulType
191 o = _testcapi.ipowType()
220 _testcapi.return_null_without_error()
254 _testcapi.return_result_with_error()
260 _testcapi.test_buildvalue_N()
314 self.assertListEqual(_testcapi.get_mapping_keys(mapping),
316 self.assertListEqual(_testcapi.get_mapping_values(mapping),
318 self.assertListEqual(_testcapi.get_mapping_items(mapping),
322 self.assertRaises(AttributeError, _testcapi.get_mapping_keys, None)
323 self.assertRaises(AttributeError, _testcapi.get_mapping_values, None)
324 self.assertRaises(AttributeError, _testcapi.get_mapping_items, None)
334 self.assertRaises(TypeError, _testcapi.get_mapping_keys, bad_mapping)
335 self.assertRaises(TypeError, _testcapi.get_mapping_values, bad_mapping)
336 self.assertRaises(TypeError, _testcapi.get_mapping_items, bad_mapping)
338 @unittest.skipUnless(hasattr(_testcapi, 'negative_refcount'),
359 from _testcapi import MyList
370 from _testcapi import MyList
402 class HeapGcCTypeSubclass(_testcapi.HeapGcCType):
419 class A(_testcapi.HeapGcCType):
454 inst = _testcapi.HeapCTypeWithDict()
460 inst = _testcapi.HeapCTypeWithDict()
464 inst = _testcapi.HeapCTypeWithNegativeDict()
470 inst = _testcapi.HeapCTypeWithNegativeDict()
474 inst = _testcapi.HeapCTypeWithWeakref()
480 inst = _testcapi.HeapCTypeWithBuffer()
485 subclass_instance = _testcapi.HeapCTypeSubclass()
486 type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclass)
494 self.assertEqual(type_refcnt - 1, sys.getrefcount(_testcapi.HeapCTypeSubclass))
497 subclass_instance = _testcapi.HeapCTypeSubclassWithFinalizer()
498 type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclassWithFinalizer)
499 new_type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclass)
509 self.assertEqual(type_refcnt - 1, _testcapi.HeapCTypeSubclassWithFinalizer.refcnt_in_del)
510 self.assertEqual(new_type_refcnt + 1, _testcapi.HeapCTypeSubclass.refcnt_in_del)
513 self.assertEqual(type_refcnt - 1, sys.getrefcount(_testcapi.HeapCTypeSubclassWithFinalizer))
516 self.assertEqual(new_type_refcnt, sys.getrefcount(_testcapi.HeapCTypeSubclass))
519 obj = _testcapi.HeapCTypeSetattr()
527 from _testcapi import pynumber_tobase
555 if _testcapi._pending_threadfunc(callback):
683 _testcapi._test_thread_state(callback)
697 locals().update((name, getattr(_testcapi, name))
698 for name in dir(_testcapi)