mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
test_pdb: fix failure of test_issue13183 in debug mode, and make sure files are cleaned up.
This commit is contained in:
parent
5c01678174
commit
4bde9caf74
1 changed files with 5 additions and 2 deletions
|
@ -604,6 +604,7 @@ class PdbTestCase(unittest.TestCase):
|
|||
filename = 'main.py'
|
||||
with open(filename, 'w') as f:
|
||||
f.write(textwrap.dedent(script))
|
||||
self.addCleanup(support.unlink, filename)
|
||||
cmd = [sys.executable, '-m', 'pdb', filename]
|
||||
stdout = stderr = None
|
||||
with subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
|
@ -660,9 +661,11 @@ class PdbTestCase(unittest.TestCase):
|
|||
"""
|
||||
with open('bar.py', 'w') as f:
|
||||
f.write(textwrap.dedent(bar))
|
||||
self.addCleanup(support.unlink, 'bar.py')
|
||||
stdout, stderr = self.run_pdb(script, commands)
|
||||
self.assertIn('main.py(5)foo()->None', stdout.split('\n')[-3],
|
||||
'Fail to step into the caller after a return')
|
||||
self.assertTrue(
|
||||
any('main.py(5)foo()->None' in l for l in stdout.splitlines()),
|
||||
'Fail to step into the caller after a return')
|
||||
|
||||
def tearDown(self):
|
||||
support.unlink(support.TESTFN)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue