summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-25 08:07:37 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-25 08:07:37 (GMT)
commite08e3d06864c5ad993f74613d9ed4ce69cc6cbc6 (patch)
tree7f8d08a1089aba9d116273c83e4545347967a60a /Lib/test/test_gzip.py
parentecd0ad3c573fd606c05fd550c5393a077b1a9c33 (diff)
downloadcpython-e08e3d06864c5ad993f74613d9ed4ce69cc6cbc6.zip
cpython-e08e3d06864c5ad993f74613d9ed4ce69cc6cbc6.tar.gz
cpython-e08e3d06864c5ad993f74613d9ed4ce69cc6cbc6.tar.bz2
#2959: allow multiple close() calls for GzipFile.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index a1a267e..105882a 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -24,14 +24,14 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */
class TestGzip(unittest.TestCase):
filename = test_support.TESTFN
- def setUp (self):
+ def setUp(self):
test_support.unlink(self.filename)
- def tearDown (self):
+ def tearDown(self):
test_support.unlink(self.filename)
- def test_write (self):
+ def test_write(self):
f = gzip.GzipFile(self.filename, 'wb') ; f.write(data1 * 50)
# Try flush and fileno.
@@ -41,6 +41,9 @@ class TestGzip(unittest.TestCase):
os.fsync(f.fileno())
f.close()
+ # Test multiple close() calls.
+ f.close()
+
def test_read(self):
self.test_write()
# Try reading.