diff options
author | Georg Brandl <georg@python.org> | 2012-05-01 07:21:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-05-01 07:21:16 (GMT) |
commit | 4bde9caf7476eb9a9fc360eda2918962d954720b (patch) | |
tree | f10b6bb4c880234c4bbfa7b83ce731eaa2cb4d8e /Lib/test/test_pdb.py | |
parent | 5c01678174276449070dabc467823d7a55f1cfab (diff) | |
download | cpython-4bde9caf7476eb9a9fc360eda2918962d954720b.zip cpython-4bde9caf7476eb9a9fc360eda2918962d954720b.tar.gz cpython-4bde9caf7476eb9a9fc360eda2918962d954720b.tar.bz2 |
test_pdb: fix failure of test_issue13183 in debug mode, and make sure files are cleaned up.
Diffstat (limited to 'Lib/test/test_pdb.py')
-rw-r--r-- | 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 index ac92931..1570873 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -604,6 +604,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, @@ -660,9 +661,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) |