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

Method test_module_is_run_as_main

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

Source from the content-addressed store, hash-verified

4134 self.assertTrue(any("SUCCESS" in l for l in stdout.splitlines()), stdout)
4135
4136 def test_module_is_run_as_main(self):
4137 script = """
4138 if __name__ == '__main__':
4139 print("SUCCESS")
4140 """
4141 commands = """
4142 continue
4143 quit
4144 """
4145 stdout, stderr = self.run_pdb_module(script, commands)
4146 self.assertTrue(any("SUCCESS" in l for l in stdout.splitlines()), stdout)
4147
4148 def test_run_module_with_args(self):
4149 commands = """

Callers

nothing calls this directly

Calls 4

run_pdb_moduleMethod · 0.95
assertTrueMethod · 0.80
anyFunction · 0.50
splitlinesMethod · 0.45

Tested by

no test coverage detected