[Python-checkins] r52341 - python/trunk/Lib/test/test_os.py

martin.v.loewis python-checkins at python.org
Sun Oct 15 13:02:08 CEST 2006


Author: martin.v.loewis
Date: Sun Oct 15 13:02:07 2006
New Revision: 52341

Modified:
   python/trunk/Lib/test/test_os.py
Log:
Round to int, because some systems support sub-second time stamps in stat, but not in utime.
Also be consistent with modifying only mtime, not atime.

Modified: python/trunk/Lib/test/test_os.py
==============================================================================
--- python/trunk/Lib/test/test_os.py	(original)
+++ python/trunk/Lib/test/test_os.py	Sun Oct 15 13:02:07 2006
@@ -226,9 +226,11 @@
     def test_utime_dir(self):
         delta = 1000000
         st = os.stat(test_support.TESTFN)
-        os.utime(test_support.TESTFN, (st.st_atime, st.st_mtime-delta))
+        # round to int, because some systems may support sub-second
+        # time stamps in stat, but not in utime.
+        os.utime(test_support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
         st2 = os.stat(test_support.TESTFN)
-        self.assertAlmostEquals(st2.st_mtime, st.st_mtime-delta, 2)
+        self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
 
     # Restrict test to Win32, since there is no guarantee other
     # systems support centiseconds


More information about the Python-checkins mailing list