Georg Brandl committed 1b174a1

test_pdb: fix failure of test_issue13183 in debug mode, and make sure files are cleaned up.

  • Participants
  • Parent commits 7bdac82

Comments (0)

Files changed (1)

File Lib/test/

         filename = ''
         with open(filename, 'w') as f:
+        self.addCleanup(support.unlink, filename)
         cmd = [sys.executable, '-m', 'pdb', filename]
         stdout = stderr = None
         with subprocess.Popen(cmd, stdout=subprocess.PIPE,
         with open('', 'w') as f:
+        self.addCleanup(support.unlink, '')
         stdout, stderr = self.run_pdb(script, commands)
-        self.assertIn('>None', stdout.split('\n')[-3],
-                         'Fail to step into the caller after a return')
+        self.assertTrue(
+            any('>None' in l for l in stdout.splitlines()),
+            'Fail to step into the caller after a return')
     def tearDown(self):