diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-12-17 09:36:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 09:36:36 +0100 |
commit | 2cf4c202ffeb30787c944365ba54013688b854c2 (patch) | |
tree | aa98e69de819cb1cd0f5bd25fb10636f98001ff2 /Lib/test/test_asyncio/utils.py | |
parent | 4e80f5cbeaee87a26e49bc9623c92a10e28dbbd9 (diff) | |
download | cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.gz cpython-2cf4c202ffeb30787c944365ba54013688b854c2.zip |
bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)
Replace time.time() with time.monotonic() in tests to measure time
delta.
test_zipfile64: display progress every minute (60 secs) rather than
every 5 minutes (5*60 seconds).
Diffstat (limited to 'Lib/test/test_asyncio/utils.py')
-rw-r--r-- | Lib/test/test_asyncio/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index 8b23b017507..cb373d544f4 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -107,10 +107,10 @@ def run_briefly(loop): def run_until(loop, pred, timeout=30): - deadline = time.time() + timeout + deadline = time.monotonic() + timeout while not pred(): if timeout is not None: - timeout = deadline - time.time() + timeout = deadline - time.monotonic() if timeout <= 0: raise futures.TimeoutError() loop.run_until_complete(tasks.sleep(0.001)) |