summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMarcel Plch <mplch@redhat.com>2018-08-31 14:43:31 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-08-31 14:43:31 (GMT)
commit77b112cd56a50232abcdbf28f9aba88dc5d33ad3 (patch)
tree29cc007270c33892d68a5b7dc3b5266e2fc85c2f /Lib/test
parent1b5f9c9653f348b0aa8b7ca39f8a9361150f7dfc (diff)
downloadcpython-77b112cd56a50232abcdbf28f9aba88dc5d33ad3.zip
cpython-77b112cd56a50232abcdbf28f9aba88dc5d33ad3.tar.gz
cpython-77b112cd56a50232abcdbf28f9aba88dc5d33ad3.tar.bz2
bpo-34097: Polish API design (GH-8725)
Move strict_timestamps to constructor.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_zipfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 68b56a0..4c6f57c 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -549,8 +549,8 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
with zipfile.ZipFile(TESTFN2, "w") as zipfp:
self.assertRaises(ValueError, zipfp.write, TESTFN)
- with zipfile.ZipFile(TESTFN2, "w") as zipfp:
- zipfp.write(TESTFN, strict_timestamps=False)
+ with zipfile.ZipFile(TESTFN2, "w", strict_timestamps=False) as zipfp:
+ zipfp.write(TESTFN)
zinfo = zipfp.getinfo(TESTFN)
self.assertEqual(zinfo.date_time, (1980, 1, 1, 0, 0, 0))
@@ -564,8 +564,8 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
with zipfile.ZipFile(TESTFN2, "w") as zipfp:
self.assertRaises(struct.error, zipfp.write, TESTFN)
- with zipfile.ZipFile(TESTFN2, "w") as zipfp:
- zipfp.write(TESTFN, strict_timestamps=False)
+ with zipfile.ZipFile(TESTFN2, "w", strict_timestamps=False) as zipfp:
+ zipfp.write(TESTFN)
zinfo = zipfp.getinfo(TESTFN)
self.assertEqual(zinfo.date_time, (2107, 12, 31, 23, 59, 59))