[pypy-svn] r64372 - pypy/trunk/pypy/module/rctime/test

arigo at codespeak.net arigo at codespeak.net
Sun Apr 19 16:06:11 CEST 2009


Author: arigo
Date: Sun Apr 19 16:06:10 2009
New Revision: 64372

Modified:
   pypy/trunk/pypy/module/rctime/test/test_rctime.py
Log:
An app-level test for time.time()'s resolution.


Modified: pypy/trunk/pypy/module/rctime/test/test_rctime.py
==============================================================================
--- pypy/trunk/pypy/module/rctime/test/test_rctime.py	(original)
+++ pypy/trunk/pypy/module/rctime/test/test_rctime.py	Sun Apr 19 16:06:10 2009
@@ -29,9 +29,12 @@
 
     def test_time(self):
         import time as rctime
-        rctime.time()
+        t1 = rctime.time()
         assert isinstance(rctime.time(), float)
         assert rctime.time() != 0.0 # 0.0 means failure
+        rctime.sleep(0.02)
+        t2 = rctime.time()
+        assert t1 != t2       # the resolution should be at least 0.01 secs
 
     def test_ctime(self):
         import time as rctime



More information about the Pypy-commit mailing list