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