[Python-checkins] r86017 - python/branches/py3k/Lib/test/test_subprocess.py

benjamin.peterson python-checkins at python.org
Sun Oct 31 03:06:21 CET 2010


Author: benjamin.peterson
Date: Sun Oct 31 03:06:21 2010
New Revision: 86017

Log:
close some more files

Modified:
   python/branches/py3k/Lib/test/test_subprocess.py

Modified: python/branches/py3k/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k/Lib/test/test_subprocess.py	Sun Oct 31 03:06:21 2010
@@ -173,6 +173,7 @@
     def test_stdin_filedes(self):
         # stdin is set to open file descriptor
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         d = tf.fileno()
         os.write(d, b"pear")
         os.lseek(d, 0, 0)
@@ -185,6 +186,7 @@
     def test_stdin_fileobj(self):
         # stdin is set to open file object
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         tf.write(b"pear")
         tf.seek(0)
         p = subprocess.Popen([sys.executable, "-c",
@@ -203,6 +205,7 @@
     def test_stdout_filedes(self):
         # stdout is set to open file descriptor
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         d = tf.fileno()
         p = subprocess.Popen([sys.executable, "-c",
                           'import sys; sys.stdout.write("orange")'],
@@ -214,6 +217,7 @@
     def test_stdout_fileobj(self):
         # stdout is set to open file object
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         p = subprocess.Popen([sys.executable, "-c",
                           'import sys; sys.stdout.write("orange")'],
                          stdout=tf)
@@ -231,6 +235,7 @@
     def test_stderr_filedes(self):
         # stderr is set to open file descriptor
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         d = tf.fileno()
         p = subprocess.Popen([sys.executable, "-c",
                           'import sys; sys.stderr.write("strawberry")'],
@@ -242,6 +247,7 @@
     def test_stderr_fileobj(self):
         # stderr is set to open file object
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         p = subprocess.Popen([sys.executable, "-c",
                           'import sys; sys.stderr.write("strawberry")'],
                          stderr=tf)
@@ -263,6 +269,7 @@
     def test_stdout_stderr_file(self):
         # capture stdout and stderr to the same open file
         tf = tempfile.TemporaryFile()
+        self.addCleanup(tf.close)
         p = subprocess.Popen([sys.executable, "-c",
                               'import sys;'
                               'sys.stdout.write("apple");'


More information about the Python-checkins mailing list