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

Method test_invalid_names

Lib/test/test_runpy.py:204–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

202 self.fail("Expected import error for " + mod_name)
203
204 def test_invalid_names(self):
205 # Builtin module
206 self.expect_import_error("sys")
207 # Non-existent modules
208 self.expect_import_error("sys.imp.eric")
209 self.expect_import_error("os.path.half")
210 self.expect_import_error("a.bee")
211 # Relative names not allowed
212 self.expect_import_error(".howard")
213 self.expect_import_error("..eaten")
214 self.expect_import_error(".test_runpy")
215 self.expect_import_error(".unittest")
216 # Package without __main__.py
217 self.expect_import_error("multiprocessing")
218
219 def test_library_module(self):
220 self.assertEqual(run_module("runpy")["__name__"], "runpy")

Callers

nothing calls this directly

Calls 1

expect_import_errorMethod · 0.95

Tested by

no test coverage detected