Commit 1ec917e7 authored by Jim Fulton's avatar Jim Fulton

Fixed a spurious windows error due to Window's low-resolution clock.

parent 25b9f257
......@@ -5,6 +5,17 @@ DemoStorage demo (doctest)
DemoStorages provide a way to provide incremental updates to an
existing, base, storage without updating the storage.
.. We need to mess with time to prevent spurious test failures on windows
>>> now = 1231019584.0
>>> def faux_time_time():
... global now
... now += .1
... return now
>>> import time
>>> real_time_time = time.time
>>> time.time = faux_time_time
To see how this works, we'll start by creating a base storage and
puting an object (in addition to the root object) in it:
......@@ -73,7 +84,7 @@ Our lastTransaction reflects the lastTransaction of the changes:
>>> storage.lastTransaction() == changes.lastTransaction()
True
Let's walk over some of the methods so ewe can see how we delegate to
Let's walk over some of the methods so we can see how we delegate to
the new underlying storages:
>>> from ZODB.utils import p64, u64
......@@ -378,3 +389,7 @@ DemoStorage keeps up with the issued OIDs to know when not to reissue them...
We're done with the storage, so "unwrap" the underlying storage.
>>> storage = storage.pop()
.. restore time
>>> time.time = real_time_time
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment