Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] tests: Fix time tracking in process_events #3041

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Orange/widgets/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def process_events(self, until: callable=None, timeout=DEFAULT_TIMEOUT):
if until is None:
until = lambda: True

started = time.clock()
started = time.perf_counter()
while True:
app.processEvents()
try:
Expand All @@ -192,7 +192,7 @@ def process_events(self, until: callable=None, timeout=DEFAULT_TIMEOUT):
return result
except Exception: # until can fail with anything; pylint: disable=broad-except
pass
if (time.clock() - started) * 1000 > timeout:
if (time.perf_counter() - started) * 1000 > timeout:
raise TimeoutError()
time.sleep(.05)

Expand Down