summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-05-06 09:50:00 (GMT)
committerGeorg Brandl <georg@python.org>2012-05-06 09:50:00 (GMT)
commitb4c8902a8727f99a4d361f6a3ebafa5002e56030 (patch)
tree5b626a5689b7d373cecc2a6691a790f7723a1c27 /Lib/test/test_pdb.py
parent7ef909cdd7af66d63eedf68519eed146fdf5de39 (diff)
downloadcpython-b4c8902a8727f99a4d361f6a3ebafa5002e56030.zip
cpython-b4c8902a8727f99a4d361f6a3ebafa5002e56030.tar.gz
cpython-b4c8902a8727f99a4d361f6a3ebafa5002e56030.tar.bz2
#13183: backport fixes to test_pdb to 3.2 branch
Diffstat (limited to 'Lib/test/test_pdb.py')
-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 253fcaf..d28b042 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -601,6 +601,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,
@@ -657,9 +658,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)