MCPcopy Index your code
hub / github.com/RustPython/RustPython / expect_import_error

Method expect_import_error

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

Source from the content-addressed store, hash-verified

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

Callers 1

test_invalid_namesMethod · 0.95

Calls 2

run_moduleFunction · 0.90
failMethod · 0.45

Tested by

no test coverage detected