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

Method test_issue58956

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

Source from the content-addressed store, hash-verified

3945 self.assertRegex(res, "Restarting .* with arguments:\nd e f")
3946
3947 def test_issue58956(self):
3948 # Set a breakpoint in a function that already exists on the call stack
3949 # should enable the trace function for the frame.
3950 script = """
3951 import bar
3952 def foo():
3953 ret = bar.bar()
3954 pass
3955 foo()
3956 """
3957 commands = """
3958 b bar.bar
3959 c
3960 b main.py:5
3961 c
3962 p ret
3963 quit
3964 """
3965 bar = """
3966 def bar():
3967 return 42
3968 """
3969 with open('bar.py', 'w') as f:
3970 f.write(textwrap.dedent(bar))
3971 self.addCleanup(os_helper.unlink, 'bar.py')
3972 stdout, stderr = self.run_pdb_script(script, commands)
3973 lines = stdout.splitlines()
3974 self.assertIn('-> pass', lines)
3975 self.assertIn('(Pdb) 42', lines)
3976
3977 def test_step_into_botframe(self):
3978 # gh-125422

Callers

nothing calls this directly

Calls 7

run_pdb_scriptMethod · 0.95
addCleanupMethod · 0.80
assertInMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
dedentMethod · 0.45
splitlinesMethod · 0.45

Tested by

no test coverage detected