Add `VirtualTime` implementation that currently patches `time.time`, `datetime.datetime.now/utcnow` and the equivalent `datetime_tz` functions. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14105 25043fe6-1616-0410-a82d-ba8f324cfe61
Added support for UTC time setting as well in tests - using helper functions to calculate time and run tests. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14106 25043fe6-1616-0410-a82d-ba8f324cfe61
Make the API for setting datetime time available, and genericize the real time tests. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14107 25043fe6-1616-0410-a82d-ba8f324cfe61
Add support for `time.localtime`. Add sleeps to tests as required, and helper for testing derived time objects against a reference function. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14108 25043fe6-1616-0410-a82d-ba8f324cfe61
Added remainder of override functions for `time` module, and tests for them. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14109 25043fe6-1616-0410-a82d-ba8f324cfe61
Rename `real_time` to `restore_time`. Add test for timezones, and some `TODO`s. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14110 25043fe6-1616-0410-a82d-ba8f324cfe61
Handle order of time strings. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14111 25043fe6-1616-0410-a82d-ba8f324cfe61
Added decorator to make sure we really restore time even if something fails. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14113 25043fe6-1616-0410-a82d-ba8f324cfe61
Added a virtual override for sleep - not very nice yet... and docs and TODO. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14117 25043fe6-1616-0410-a82d-ba8f324cfe61
Rather use a `Condition` to notify any waiting sleeping processes... do a nearly-busy loop around acquiring the related lock. See #6165 * Support passing in a `time_function` to `Basic.TimedLock`. We don't use it though, as it doesn't work well enough for this. * Add a test for many threads sleeping

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14118 25043fe6-1616-0410-a82d-ba8f324cfe61
Improve the parallel thread sleep test after finding that with starting many threads, they many not all have yet fetched their start time when we start the time forward. See #6165 * This was basically a race condition on the sleep lock acquisition. Add a check for the `waiters` being added to the `Condition` (relies on the internal implementation of `_virtual_sleep` and `Condition`) * Add a longer test run that reliably caught this error by repeating * Measure the time from the point when we know all the thread actually started (but also make sure they start in a reasonable time frame) * Adjust the number of repeats again

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14119 25043fe6-1616-0410-a82d-ba8f324cfe61
Added test for `Timer`s that has a helper function that steps forward through time gradually. Also add `restore_time_after` decorator to sleep tests. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14122 25043fe6-1616-0410-a82d-ba8f324cfe61
Added a system for notifying a set of events (`weakref`ed so that they don't need to be cleaned up) when the virtual time changes. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14123 25043fe6-1616-0410-a82d-ba8f324cfe61
Made `fast_forward_time` a `VirtualTime` method, as it's useful for testing, and let it take a `target` time as alternative to `delta`, and deal with the original `_time_offset` intelligently... See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14125 25043fe6-1616-0410-a82d-ba8f324cfe61
Added TODOs. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14126 25043fe6-1616-0410-a82d-ba8f324cfe61
Moved `Timer` virtual time tests back into `test_Timer` and merged with the original tests. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14127 25043fe6-1616-0410-a82d-ba8f324cfe61
Only subtract from the `delta` if we're given a `target`. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14128 25043fe6-1616-0410-a82d-ba8f324cfe61
Added test for `fast_forward_time`, and fix up handling of negative adjustments as a result. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14129 25043fe6-1616-0410-a82d-ba8f324cfe61
Added `datetime`-style equivalents of `forward` function calls. See #6165 * Also added more tests for negative time deltas, and copied `totalseconds_float` to `VirtualTime`.

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14131 25043fe6-1616-0410-a82d-ba8f324cfe61
Added a system for delaying `fast_forward_time` and related calls until events have been completed. Waits for maximum one minute per event. Use for `SchedulerTask`. See #6165

git-svn-id: svn+ssh://svn.sjsoft.com/home/opensvn/svn/trunk@14132 25043fe6-1616-0410-a82d-ba8f324cfe61