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

make wait time test more robust #787

Merged
merged 1 commit into from
Oct 10, 2017
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
7 changes: 6 additions & 1 deletion qcodes/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ def test_good_calls(self):
finish_clock = time.perf_counter() + secs
secs_out = wait_secs(finish_clock)
self.assertGreater(secs_out, secs - 1e-4)
self.assertLessEqual(secs_out, secs)
# add a tiny offset as this test may fail if
# otherwise if the two calls to perf_counter are close
# enough to return the same result as a + b - a cannot
# in general be assumed to be <= b in floating point
# math (here a is perf_counter() and b is the wait time
self.assertLessEqual(secs_out, secs+1e-14)

def test_warning(self):
with LogCapture() as logs:
Expand Down