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_timer.py

16 lines
295 B

from wraptor.context import timer
import time
def test_basic():
with timer() as t:
time.sleep(0.1000000) # sleep 100 ms
assert t.interval >= 100
def test_params():
with timer('test') as t:
pass
assert t.name == 'test'
assert str(t).startswith('test')