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

Method test_module_without_a_main

Lib/test/test_pdb.py:4202–4213  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4200 )
4201
4202 def test_module_without_a_main(self):
4203 module_name = 't_main'
4204 os_helper.rmtree(module_name)
4205 init_file = module_name + '/__init__.py'
4206 os.mkdir(module_name)
4207 with open(init_file, 'w'):
4208 pass
4209 self.addCleanup(os_helper.rmtree, module_name)
4210 stdout, stderr = self._run_pdb(
4211 ['-m', module_name], "", expected_returncode=1
4212 )
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'

Callers

nothing calls this directly

Calls 5

_run_pdbMethod · 0.95
addCleanupMethod · 0.80
assertInMethod · 0.80
openFunction · 0.50
mkdirMethod · 0.45

Tested by

no test coverage detected