travis-ci
16 of 16 new or added lines in 1 file covered. (100.0%)
436 of 462 relevant lines covered (94.37%)
6.31 hits per line
1 |
import functools |
2 only 453.6 and 453.8 ✔ |
2 |
|
|
3 |
import asyncio |
2 only 453.6 and 453.8 ✔ |
4 |
|
|
5 |
|
|
6 |
def wrap_coroutine(api, coroutine): |
2 only 453.6 and 453.8 ✔ |
7 |
@functools.wraps(coroutine)
|
2 only 453.6 and 453.8 ✔ |
8 |
@asyncio.coroutine
|
2 only 453.6 and 453.8 ✔ |
9 |
def wrapper(*args, **kwargs): |
|
10 |
with api as time_factory: |
2 only 453.6 and 453.8 ✔ |
11 |
if api.as_arg:
|
2 only 453.6 and 453.8 ✔ |
12 |
result = yield from coroutine(time_factory, *args, **kwargs) |
× |
13 |
else:
|
|
14 |
result = yield from coroutine(*args, **kwargs) |
2 only 453.6 and 453.8 ✔ |
15 |
return result
|
2 only 453.6 and 453.8 ✔ |
16 |
|
|
17 |
return wrapper
|
2 only 453.6 and 453.8 ✔ |