We'll provide a mock
time.time() in our test fixture and use it in our doctest.
times.txtcontaining the following doctest code:
>>> from time import time This isn't a reasonable test for any purpose, but it serves to illustrate a test that can't work without a mock object in place. >>> '%0.1f' % time() '1.0' >>> '%0.1f' % time() '1.1' >>> '%0.1f' % time() '1.2'