eugeniy / pytest-tornado

A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications.
Apache License 2.0
121 stars 34 forks source link

Fixed missing support for type annotated test functions #19

Closed nellessen closed 5 years ago

nellessen commented 7 years ago

This fixes an issue when you try to annotate types of your test function parameters; e.g.:

@pytest.mark.gen_test
async def test_hello_world(http_client: AsyncHTTPClient):
    response = await http_client.fetch('/')
    assert response.code == 200

The above code will raise a ValueError: ValueError: Function has keyword-only parameters or annotations, use getfullargspec() API which can support them

vidartf commented 5 years ago

@nellessen I added a test to #43 showing that this should now work on master. Feel free to comment if there are still issues, and I can reopen this!