Commits

Georg Brandl committed 2644e4e

#13183: backport fixes to test_pdb to 2.7 branch

Comments (0)

Files changed (1)

Lib/test/test_pdb.py

         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,
         """
         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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.