MCPcopy Index your code
hub / github.com/python/cpython / test_addmoduleref

Method test_addmoduleref

Lib/test/test_capi/test_import.py:106–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 # CRASHES addmodule(NULL)
105
106 def test_addmoduleref(self):
107 # Test PyImport_AddModuleRef()
108 addmoduleref = _testlimitedcapi.PyImport_AddModuleRef
109 self.check_addmodule(addmoduleref)
110
111 self.assertRaises(UnicodeDecodeError, addmoduleref, b'\xff')
112 # CRASHES addmoduleref(NULL)
113
114 def check_import_func(self, import_module):
115 self.check_import_loaded_module(import_module)

Callers

nothing calls this directly

Calls 2

check_addmoduleMethod · 0.95
assertRaisesMethod · 0.45

Tested by

no test coverage detected