summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-05-06 09:53:51 (GMT)
committerGeorg Brandl <georg@python.org>2012-05-06 09:53:51 (GMT)
commit9f9970b15d356bc0adee1dc7bb11bfc63712e7fd (patch)
tree45c2338f8e7cf9bb86211a942639a0b45a83d1ff
parent9a16fa69dda64ed01b2239a732c0445f22babb57 (diff)
downloadcpython-9f9970b15d356bc0adee1dc7bb11bfc63712e7fd.zip
cpython-9f9970b15d356bc0adee1dc7bb11bfc63712e7fd.tar.gz
cpython-9f9970b15d356bc0adee1dc7bb11bfc63712e7fd.tar.bz2
#13183: backport fixes to test_pdb to 2.7 branch
-rw-r--r--Lib/test/test_pdb.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 5c1a37c..559f756 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -20,6 +20,7 @@ class PdbTestCase(unittest.TestCase):
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 @@ class PdbTestCase(unittest.TestCase):
"""
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):