summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-02-25 11:16:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-02-25 11:16:02 (GMT)
commitf799ca82a068a2cc86e249a8bad377e5d3fa9dd9 (patch)
tree3850ed7feb246ac988255e6b29aef13b13fd6442 /Lib/test
parent62bc32181901061fbadfc7e68c518871f6d8faea (diff)
parentf828218d652fe8120d88cfefa52df5c2039cdf92 (diff)
downloadcpython-f799ca82a068a2cc86e249a8bad377e5d3fa9dd9.zip
cpython-f799ca82a068a2cc86e249a8bad377e5d3fa9dd9.tar.gz
cpython-f799ca82a068a2cc86e249a8bad377e5d3fa9dd9.tar.bz2
Issue #25801: Fixed resource warnings in test_zipfile64.
Patch by SilentGhost.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_zipfile64.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py
index b9e8e28..c29bd8d 100644
--- a/Lib/test/test_zipfile64.py
+++ b/Lib/test/test_zipfile64.py
@@ -72,15 +72,19 @@ class TestsWithSourceFile(unittest.TestCase):
def testStored(self):
# Try the temp file first. If we do TESTFN2 first, then it hogs
# gigabytes of disk space for the duration of the test.
- for f in TemporaryFile(), TESTFN2:
+ with TemporaryFile() as f:
self.zipTest(f, zipfile.ZIP_STORED)
+ self.assertFalse(f.closed)
+ self.zipTest(TESTFN2, zipfile.ZIP_STORED)
@requires_zlib
def testDeflated(self):
# Try the temp file first. If we do TESTFN2 first, then it hogs
# gigabytes of disk space for the duration of the test.
- for f in TemporaryFile(), TESTFN2:
+ with TemporaryFile() as f:
self.zipTest(f, zipfile.ZIP_DEFLATED)
+ self.assertFalse(f.closed)
+ self.zipTest(TESTFN2, zipfile.ZIP_DEFLATED)
def tearDown(self):
for fname in TESTFN, TESTFN2: