]> granicus.if.org Git - python/commitdiff
bpo-34325: Skip zipfile test for large timestamps when filesystem don't support them...
authorMarcel Plch <gmarcel.plch@gmail.com>
Fri, 3 Aug 2018 15:59:19 +0000 (17:59 +0200)
committerPetr Viktorin <encukou@gmail.com>
Fri, 3 Aug 2018 15:59:19 +0000 (17:59 +0200)
When the filesystem doesn't support files with large timestamps,
skip testing that such files can be zipped.

Lib/test/test_zipfile.py

index 3b78b7f16759b3b1980e5a4c9960c5215da3f848..68b56a0cd988bb413e137f0d00abd3762560544c 100644 (file)
@@ -556,7 +556,11 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
 
     def test_add_file_after_2107(self):
         # Set atime and mtime to 2108-12-30
-        os.utime(TESTFN, (4386268800, 4386268800))
+        try:
+            os.utime(TESTFN, (4386268800, 4386268800))
+        except OverflowError:
+            self.skipTest('Host fs cannot set timestamp to required value.')
+
         with zipfile.ZipFile(TESTFN2, "w") as zipfp:
             self.assertRaises(struct.error, zipfp.write, TESTFN)