[Python-checkins] cpython: Issue #11022 and #15287: correctly remove the TESTFN file in test_builtin.

florent.xicluna python-checkins at python.org
Sun Jul 8 12:08:59 CEST 2012


http://hg.python.org/cpython/rev/6651c932d014
changeset:   77997:6651c932d014
user:        Florent Xicluna <florent.xicluna at gmail.com>
date:        Sun Jul 08 12:08:45 2012 +0200
summary:
  Issue #11022 and #15287: correctly remove the TESTFN file in test_builtin.

files:
  Lib/test/test_builtin.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -960,7 +960,7 @@
             self.assertEqual(fp.read(1000), 'YYY'*100)
         finally:
             fp.close()
-        unlink(TESTFN)
+            unlink(TESTFN)
 
     def test_open_default_encoding(self):
         old_environ = dict(os.environ)
@@ -979,6 +979,7 @@
                 self.assertEqual(fp.encoding, current_locale_encoding)
             finally:
                 fp.close()
+                unlink(TESTFN)
         finally:
             os.environ.clear()
             os.environ.update(old_environ)

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


More information about the Python-checkins mailing list