[Python-checkins] cpython (3.2): #13183: backport fixes to test_pdb to 3.2 branch

georg.brandl python-checkins at python.org
Sun May 6 11:49:54 CEST 2012


http://hg.python.org/cpython/rev/e275a9f7daa9
changeset:   76782:e275a9f7daa9
branch:      3.2
parent:      76773:afab4d14d5e7
user:        Georg Brandl <georg at python.org>
date:        Sun May 06 11:50:00 2012 +0200
summary:
  #13183: backport fixes to test_pdb to 3.2 branch

files:
  Lib/test/test_pdb.py |  7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -601,6 +601,7 @@
         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 @@
         """
         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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list