(original) (raw)

changeset: 76783:2644e4ea02d3 branch: 2.7 parent: 76772:35ef949e85d7 user: Georg Brandl georg@python.org date: Sun May 06 11:53:51 2012 +0200 files: Lib/test/test_pdb.py description: #13183: backport fixes to test_pdb to 2.7 branch diff -r 35ef949e85d7 -r 2644e4ea02d3 Lib/test/test_pdb.py --- a/Lib/test/test_pdb.py Sat May 05 20:41:08 2012 +0100 +++ b/Lib/test/test_pdb.py Sun May 06 11:53:51 2012 +0200 @@ -20,6 +20,7 @@ filename = 'main.py' with open(filename, 'w') as f: f.write(textwrap.dedent(script)) + self.addCleanup(test_support.unlink, filename) cmd = [sys.executable, '-m', 'pdb', filename] stdout = stderr = None proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, @@ -61,9 +62,11 @@ """ with open('bar.py', 'w') as f: f.write(textwrap.dedent(bar)) + self.addCleanup(test_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') class PdbTestInput(object): /georg@python.org