def test_elapsed(more_ms): delay_s = more_ms / 1000 less_ms = more_ms + 5 t = Timeout(1000000) time.sleep(delay_s) elapsed = t.elapsed() assert elapsed >= more_ms and elapsed <= less_ms
def test_elapsed_type(timeout_ms): t = Timeout(timeout_ms) assert type(t.elapsed()) is int