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

Method test_importmodulenoblock

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

Source from the content-addressed store, hash-verified

134 # CRASHES importmodule(NULL)
135
136 def test_importmodulenoblock(self):
137 # Test deprecated (stable ABI only) PyImport_ImportModuleNoBlock()
138 importmodulenoblock = _testlimitedcapi.PyImport_ImportModuleNoBlock
139 with check_warnings(('', DeprecationWarning)):
140 self.check_import_func(importmodulenoblock)
141 self.assertRaises(UnicodeDecodeError, importmodulenoblock, b'\xff')
142
143 # CRASHES importmodulenoblock(NULL)
144
145 def check_frozen_import(self, import_frozen_module):
146 # Importing a frozen module executes its code, so start by unloading

Callers

nothing calls this directly

Calls 3

check_import_funcMethod · 0.95
check_warningsFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected