(self)
| 4213 | self.assertIn("ImportError: No module named t_main.__main__;", stdout) |
| 4214 | |
| 4215 | def test_package_without_a_main(self): |
| 4216 | pkg_name = 't_pkg' |
| 4217 | module_name = 't_main' |
| 4218 | os_helper.rmtree(pkg_name) |
| 4219 | modpath = pkg_name + '/' + module_name |
| 4220 | os.makedirs(modpath) |
| 4221 | with open(modpath + '/__init__.py', 'w'): |
| 4222 | pass |
| 4223 | self.addCleanup(os_helper.rmtree, pkg_name) |
| 4224 | stdout, stderr = self._run_pdb( |
| 4225 | ['-m', modpath.replace('/', '.')], "", expected_returncode=1 |
| 4226 | ) |
| 4227 | self.assertIn( |
| 4228 | "'t_pkg.t_main' is a package and cannot be directly executed", |
| 4229 | stdout) |
| 4230 | |
| 4231 | def test_nonexistent_module(self): |
| 4232 | assert not os.path.exists(os_helper.TESTFN) |
nothing calls this directly
no test coverage detected