Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4c8902

Browse files
committed
#13183: backport fixes to test_pdb to 3.2 branch
1 parent 7ef909c commit b4c8902

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/test/test_pdb.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ def run_pdb(self, script, commands):
601601
filename = 'main.py'
602602
with open(filename, 'w') as f:
603603
f.write(textwrap.dedent(script))
604+
self.addCleanup(support.unlink, filename)
604605
cmd = [sys.executable, '-m', 'pdb', filename]
605606
stdout = stderr = None
606607
with subprocess.Popen(cmd, stdout=subprocess.PIPE,
@@ -657,9 +658,11 @@ def bar():
657658
"""
658659
with open('bar.py', 'w') as f:
659660
f.write(textwrap.dedent(bar))
661+
self.addCleanup(support.unlink, 'bar.py')
660662
stdout, stderr = self.run_pdb(script, commands)
661-
self.assertIn('main.py(5)foo()->None', stdout.split('\n')[-3],
662-
'Fail to step into the caller after a return')
663+
self.assertTrue(
664+
any('main.py(5)foo()->None' in l for l in stdout.splitlines()),
665+
'Fail to step into the caller after a return')
663666

664667
def tearDown(self):
665668
support.unlink(support.TESTFN)

0 commit comments

Comments
 (0)