Skip to content

Commit

Permalink
Go back to messing with time
Browse files Browse the repository at this point in the history
Tp get predictiable time specing to avoid spurious failures.
  • Loading branch information
Jim Fulton committed Jul 24, 2016
1 parent bda016b commit af20d2f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ZODB/FileStorage/iterator.test
Expand Up @@ -6,6 +6,18 @@ special tests.

We'll make some assertions about time, so we'll take it over:

>>> now = 1229959248
>>> def faux_time():
... global now
... now += 0.1
... return now
>>> import time
>>> time_time = time.time
>>> if isinstance(time,type):
... time.time = staticmethod(faux_time) # Jython
... else:
... time.time = faux_time

Commit a bunch of transactions:

>>> import ZODB.FileStorage, transaction
Expand Down Expand Up @@ -166,4 +178,5 @@ Even if we write more transactions:

.. Cleanup

>>> time.time = time_time
>>> db.close()

0 comments on commit af20d2f

Please sign in to comment.