You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
async fixtures are incompatible with pytest 3.7.0 #89
"""Adjust the event loop policy when an event loop is produced."""
ifisasyncgenfunction(fixturedef.func):
# This is an async generator function. Wrap it accordingly.
f=fixturedef.func
In pytest 3.7.0 fixturef.func is the "wrapped" function (which issues the warning when calling directly), which is not a coroutine/async function. This of course breaks this code.
@RonnyPfannschmidt unless we find a solution to this I'm considering reverting the wrapping code. pytest-asyncio probably is not the only plugin that will break because of this I'm afraid. 😟
Activity
Gr1N commentedon Jul 31, 2018
Got same issue, any ideas?
brycedrennan commentedon Jul 31, 2018
For now I've just pinned my pytest to 3.6.4
jwldk commentedon Jul 31, 2018
Same problem here. Get this error:
E TypeError: 'coroutine' object is not subscriptablewhen trying to use a async fixture in a test. Works with pytest 3.6.4. Doesn't even appear to be anything related in the pytest changelog.
JohanLorenzo commentedon Jul 31, 2018
I got a similar error. I filed this issue in pytest pytest-dev/pytest#3747 (more details in there). @RonnyPfannschmidt suggested to open an issue over here. I put up a minimal test case https://github.com/JohanLorenzo/pytest-fixture-bug-3747. Please let me know if I can provide more details.
RonnyPfannschmidt commentedon Jul 31, 2018
@jwldk fixture definition changed in pytest to give a deprecationwarning on non-fixture usage, this issue is a collateral of that
nicoddemus commentedon Aug 1, 2018
I investigated and here's the problem:
pytest-asyncio/pytest_asyncio/plugin.py
Lines 45 to 50 in 1ada096
In pytest 3.7.0
fixturef.funcis the "wrapped" function (which issues the warning when calling directly), which is not a coroutine/async function. This of course breaks this code.@RonnyPfannschmidt unless we find a solution to this I'm considering reverting the wrapping code.
pytest-asyncioprobably is not the only plugin that will break because of this I'm afraid. 😟nicoddemus commentedon Aug 1, 2018
Opened a tentative PR at pytest-dev/pytest#3754
pytest 3.7.0 doesn't work with pytest-asyncio 0.9.0. pin to old pytes…