Commit 9f9970b1 authored by Georg Brandl's avatar Georg Brandl

#13183: backport fixes to test_pdb to 2.7 branch

parent 9a16fa69
...@@ -20,6 +20,7 @@ class PdbTestCase(unittest.TestCase): ...@@ -20,6 +20,7 @@ class PdbTestCase(unittest.TestCase):
filename = 'main.py' filename = 'main.py'
with open(filename, 'w') as f: with open(filename, 'w') as f:
f.write(textwrap.dedent(script)) f.write(textwrap.dedent(script))
self.addCleanup(test_support.unlink, filename)
cmd = [sys.executable, '-m', 'pdb', filename] cmd = [sys.executable, '-m', 'pdb', filename]
stdout = stderr = None stdout = stderr = None
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
...@@ -61,9 +62,11 @@ class PdbTestCase(unittest.TestCase): ...@@ -61,9 +62,11 @@ class PdbTestCase(unittest.TestCase):
""" """
with open('bar.py', 'w') as f: with open('bar.py', 'w') as f:
f.write(textwrap.dedent(bar)) f.write(textwrap.dedent(bar))
self.addCleanup(test_support.unlink, 'bar.py')
stdout, stderr = self.run_pdb(script, commands) stdout, stderr = self.run_pdb(script, commands)
self.assertIn('main.py(5)foo()->None', stdout.split('\n')[-3], self.assertTrue(
'Fail to step into the caller after a return') any('main.py(5)foo()->None' in l for l in stdout.splitlines()),
'Fail to step into the caller after a return')
class PdbTestInput(object): class PdbTestInput(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment