mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-34097: Polish API design (GH-8725)
Move strict_timestamps to constructor.
This commit is contained in:
parent
1b5f9c9653
commit
77b112cd56
3 changed files with 19 additions and 18 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue