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

Method expect_import_error

Lib/test/test_runpy.py:197–203  ·  view source on GitHub ↗
(self, mod_name)

Source from the content-addressed store, hash-verified

195 """Unit tests for runpy.run_module"""
196
197 def expect_import_error(self, mod_name):
198 try:
199 run_module(mod_name)
200 except ImportError:
201 pass
202 else:
203 self.fail("Expected import error for " + mod_name)
204
205 def test_invalid_names(self):
206 # Builtin module

Callers 1

test_invalid_namesMethod · 0.95

Calls 2

run_moduleFunction · 0.90
failMethod · 0.45

Tested by

no test coverage detected