-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting AttributeError: 'FixtureDef' object has no attribute 'unittest'
in pytest 8.2.0
#12269
Comments
Happening to me as well. Reverting to 8.1.2 fixed it. |
Which version of pytest-asyncio are you using? |
Noddy case: import pytest
@pytest.fixture
async def myfixture():
yield 1
def test_noddy(myfixture):
assert 1 == myfixture I think this issue may have been introduced at #12096 |
This issue was already fixed in the latest version of pytest-asyncio, if you can please upgrade. If you're still on pytest-asyncio 0.21, a user made a proposal for a backport pytest-dev/pytest-asyncio#823 but I can't tell if it will be merged. |
Anything else actionable by pytest, given this is fixed by pytest-asyncio? |
Unfortunately we can't use 0.23 yet. |
We cannot use pytest-async 0.23 because of pytest-dev/pytest-asyncio#706 We need to use pytest-async 0.23 if we use pytest 8.2 because of pytest-dev/pytest#12269 This may be fixed bt this backport of the fix in pytest-async 0.23: pytest-dev/pytest-asyncio#823
I can't upgrade (and it seems like I'm not the only one) higher than v21 because of a known issue with v23 that is still being fixed:
https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html |
0.21.2 has been released and it works with pytest 8.2.0 |
The issue is resolved, I will edit the top post with information and pin for visibility for a few days. |
We cannot use pytest-async 0.23 because of pytest-dev/pytest-asyncio#706 We need to use pytest-async 0.23 if we use pytest 8.2 because of pytest-dev/pytest#12269 This may be fixed bt this backport of the fix in pytest-async 0.23: pytest-dev/pytest-asyncio#823 Test MacOs using Python 3.8 becuase GHA no longer providing 3.7 on that platform
Pytest 8.2.0 compatibility upgrade, fixes error seen while building py3-fakeredis & py3-structlog: E AttributeError: 'FixtureDef' object has no attribute 'unittest' Relevant issue: pytest-dev/pytest#12269
update pytest based on pytest-dev/pytest#12269
Maintainer note: To fix compatibility with pytest>=8.2.0, update pytest-asyncio to >=0.23.6, or >=v0.21.2 if you're on 0.21.x.
After upgrading from pytest 8.1.2 to pytest 8.2.0 I am getting the following error during tests setup:
Python version (if relevant): 3.11.6
The text was updated successfully, but these errors were encountered: