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).
This commit is contained in:
Victor Stinner 2018-12-17 09:36:36 +01:00 committed by GitHub
parent 4e80f5cbea
commit 2cf4c202ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 68 additions and 66 deletions

View file

@ -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')