bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)

Skip test_zipfile.test_add_file_after_2107() if time.localtime()
fails with OverflowError. It is the case on AIX 6.1 for example.
This commit is contained in:
Victor Stinner 2020-01-30 15:47:53 +01:00 committed by GitHub
parent 8d49f7ceb4
commit c232c9110c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -611,8 +611,13 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
def test_add_file_after_2107(self):
# Set atime and mtime to 2108-12-30
ts = 4386268800
try:
os.utime(TESTFN, (4386268800, 4386268800))
time.localtime(ts)
except OverflowError:
self.skipTest(f'time.localtime({ts}) raises OverflowError')
try:
os.utime(TESTFN, (ts, ts))
except OverflowError:
self.skipTest('Host fs cannot set timestamp to required value.')

View File

@ -0,0 +1,2 @@
Skip test_zipfile.test_add_file_after_2107() if :func:`time.localtime` fails
with :exc:`OverflowError`. It is the case on AIX 6.1 for example.