You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/wraptor/context/test/test_throttle.py

18 lines
251 B

import time
from wraptor.context import throttle
def test_basic():
arr = []
t = throttle(.1)
with t:
arr.append(1)
with t:
arr.append(1)
time.sleep(.2)
with t:
arr.append(1)
assert arr == [1, 1]