diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-12-17 08:36:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 08:36:36 (GMT) |
commit | 2cf4c202ffeb30787c944365ba54013688b854c2 (patch) | |
tree | aa98e69de819cb1cd0f5bd25fb10636f98001ff2 /Lib/test/test_timeout.py | |
parent | 4e80f5cbeaee87a26e49bc9623c92a10e28dbbd9 (diff) | |
download | cpython-2cf4c202ffeb30787c944365ba54013688b854c2.zip cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.gz cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.bz2 |
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_timeout.py')
-rw-r--r-- | Lib/test/test_timeout.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index 3c75dcc..b54fc82 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -127,11 +127,11 @@ class TimeoutTestCase(unittest.TestCase): self.sock.settimeout(timeout) method = getattr(self.sock, method) for i in range(count): - t1 = time.time() + t1 = time.monotonic() try: method(*args) except socket.timeout as e: - delta = time.time() - t1 + delta = time.monotonic() - t1 break else: self.fail('socket.timeout was not raised') |