[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/historical_connections.txt Adjusted to account for apparent asynchrony between the time and

Jim Fulton jim at zope.com
Sun Nov 2 11:58:15 EST 2008


Log message for revision 92753:
  Adjusted to account for apparent asynchrony between the time and
  datetime modules. :(
  

Changed:
  U   ZODB/trunk/src/ZODB/historical_connections.txt

-=-
Modified: ZODB/trunk/src/ZODB/historical_connections.txt
===================================================================
--- ZODB/trunk/src/ZODB/historical_connections.txt	2008-11-02 13:14:10 UTC (rev 92752)
+++ ZODB/trunk/src/ZODB/historical_connections.txt	2008-11-02 16:58:14 UTC (rev 92753)
@@ -38,12 +38,11 @@
 We wait for some time to pass, record he time, and then make some other changes.
     
     >>> import time
-    >>> t = time.time()
-    >>> while time.time() <= t:
-    ...     time.sleep(.001)    
+    >>> time.sleep(.01)
 
     >>> import datetime
     >>> now = datetime.datetime.utcnow()
+    >>> time.sleep(.01)
     
     >>> root = conn.root()
     >>> root['second'] = persistent.mapping.PersistentMapping()
@@ -258,7 +257,8 @@
 Note that if you try to open an historical connection to a time in the future,
 you will get an error.
 
-    >>> historical_conn = db.open(at=datetime.datetime.utcnow())
+    >>> historical_conn = db.open(
+    ...     at=datetime.datetime.utcnow()+datetime.timedelta(1))
     Traceback (most recent call last):
     ...
     ValueError: cannot open an historical connection in the future.



More information about the Zodb-checkins mailing list