$ cat example_test.py
import pytest
@pytest.mark.curio
async def test_some_curio_code():
res = await library.do_something()
assert b'expected result' == res
$ py.test example_test.py
====================================================== test session starts =======================================================
platform darwin -- Python 3.5.1, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /Users/scribu/git/curio-http, inifile:
plugins: curio-0.1.0
collected 1 items
example_test.py F
============================================================ FAILURES ============================================================
______________________________________________________ test_some_curio_code ______________________________________________________
pyfuncitem = <Function 'test_some_curio_code'>
@pytest.mark.tryfirst
def pytest_pyfunc_call(pyfuncitem):
"""
Run curio marked test functions in a kernel instead of a normal
function call.
"""
if 'curio' in pyfuncitem.keywords:
kernel = pyfuncitem.funcargs['kernel']
funcargs = pyfuncitem.funcargs
testargs = {arg: funcargs[arg]
for arg in pyfuncitem._fixtureinfo.argnames}
fut = pyfuncitem.obj(**testargs)
> task = kernel.add_task(fut)
E AttributeError: 'Kernel' object has no attribute 'add_task'
../../.virtualenvs/curio-http/lib/python3.5/site-packages/pytest_curio/plugin.py:33: AttributeError
==================================================== 1 failed in 0.03 seconds ====================================================
sys:1: RuntimeWarning: coroutine 'test_some_curio_code' was never awaited