From 357f5aa52eebc3c0dfc57244c6deae2d74b4ad4a Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 10 Jun 2015 17:45:40 -0700 Subject: [PATCH] Remove duplicate usage in tests also --- fasteners/tests/test_lock.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fasteners/tests/test_lock.py b/fasteners/tests/test_lock.py index 7d3b234..f0576a2 100644 --- a/fasteners/tests/test_lock.py +++ b/fasteners/tests/test_lock.py @@ -19,11 +19,6 @@ import random import threading import time -try: - from time import monotonic as now -except ImportError: - from time import time as now - from concurrent import futures import fasteners @@ -62,17 +57,17 @@ def _spawn_variation(readers, writers, max_workers=None): # TODO(harlowja): sometime in the future use a monotonic clock here # to avoid problems that can be caused by ntpd resyncing the clock # while we are actively running. - enter_time = now() + enter_time = _utils.now() time.sleep(WORK_TIMES[ident % len(WORK_TIMES)]) - exit_time = now() + exit_time = _utils.now() start_stops.append((lock.READER, enter_time, exit_time)) time.sleep(NAPPY_TIME) def write_func(ident): with lock.write_lock(): - enter_time = now() + enter_time = _utils.now() time.sleep(WORK_TIMES[ident % len(WORK_TIMES)]) - exit_time = now() + exit_time = _utils.now() start_stops.append((lock.WRITER, enter_time, exit_time)) time.sleep(NAPPY_TIME)