예제 #1
0
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
예제 #2
0
def test_elapsed_type(timeout_ms):
    t = Timeout(timeout_ms)
    assert type(t.elapsed()) is int