# Path: smarkets/utils.py
# @contextmanager
# def timed(time=time):
#     start = time()
#     result = TimedResult()
#     yield result
#     duration = (time() - start) * 1000.0
#     result._set_value(duration)


from smarkets.utils import timed
from __future__ import absolute_import, division, print_function, unicode_literals



def test_timed_works_ok():
    times = [1.0, 4.14]

    def time():
        return times.pop(0)


# Path: smarkets/utils.py
# @contextmanager
# def timed(time=time):
#     start = time()
#     result = TimedResult()
#     yield result
#     duration = (time() - start) * 1000.0
#     result._set_value(duration)


# Path: smarkets/tests/utils.py
from smarkets.utils import timed

from __future__ import absolute_import, division, print_function, unicode_literals



def test_timed_works_ok():
    times = [1.0, 4.14]

    def time():
        return times.pop(0)


    with timed(time=time) as result: