delfick / alt-pytest-asyncio

An alternative plugin for pytest to make it support async tests and fixtures
https://alt-pytest-asyncio.readthedocs.io
MIT License
27 stars 5 forks source link

Crash when parametrizing a `func` parameter #17

Closed Aran-Fey closed 4 months ago

Aran-Fey commented 5 months ago

I wrote a test case with a parametrized func parameter:

import pytest

@pytest.mark.parametrize('func', [3])
def test_something(func):
    pass

And to my surprise, got a strange error from pytest:

FAILED untitled.py::test_something[3] - TypeError: AltPytestAsyncioPlugin.pytest_pyfunc_call.<locals>.run_obj.<locals>.<lambda>() got multiple values for argument 'func'

This also happens for async test cases, though the error is slightly different:

FAILED untitled.py::test_something[3] - TypeError: converted_async_test() got multiple values for argument 'func'
delfick commented 4 months ago

Hi @Aran-Fey, thanks for the bug report. This one seems to be a fairly trivial fix, which I've released as part of 0.8.1 :)