Skip to content
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

lots of failing tests with pytest-asyncio-0.19.0 #2096

Closed
mm1ke opened this issue Aug 16, 2022 · 5 comments · Fixed by #2099 or #2101
Closed

lots of failing tests with pytest-asyncio-0.19.0 #2096

mm1ke opened this issue Aug 16, 2022 · 5 comments · Fixed by #2099 or #2101
Milestone

Comments

@mm1ke
Copy link
Contributor

mm1ke commented Aug 16, 2022

Hi,

I'm having some troubles with the gns3 tests with the latest pytest-asyncio (0.19.0 to be precise). Many tests start to fail with errors like AttributeError: 'coroutine' object has no attribute '_create_netmap_config'. Running these tests with pytest-asyncio-0.18.3 works without any failed tests.
I had a look at the changes for pytest-asyncio and the only breaking changed seemed to be the change to use strict mode by default, see: pytest-dev/pytest-asyncio#380
Another hint in this direction seems to be: pytest-dev/pytest-asyncio#390
However, i really have no idea if that is the case here, but i hope this can be fixed somehow, otherwise i would need to restrict the pytest-asyncio version on gentoo. While it would work as a temporally fix, it's also frowned up and only would make it more difficult in the future.

Our bug report with additional information can be found here: https://bugs.gentoo.org/863770

@grossmj grossmj added this to the 2.2.34 milestone Aug 16, 2022
@grossmj
Copy link
Member

grossmj commented Aug 16, 2022

Thanks for reporting this. My quick guess is that we haven't explicitly marked all the tests that are coroutines with @pytest.mark.asyncio and now the strict mode enforces it.

I will check soon and fix this soon.

@seifertm
Copy link

Sorry that the pytest-asyncio update causes trouble, but it was necessary.

The old behavior (legacy mode) caused compatibility problems for projects that wanted to support multiple async frameworks. We deprecated legacy mode at the beginning of this year and switched the default mode to strict in v0.19, which requires tests and fixtures to be explicitly marked.

Here's the relevant section in the docs:
https://github.com/pytest-dev/pytest-asyncio/tree/v0.19.0#modes

@grossmj grossmj linked a pull request Aug 24, 2022 that will close this issue
@grossmj
Copy link
Member

grossmj commented Aug 24, 2022

@mm1ke is this issue for version 3.0 or 2.2.x?

@seifertm no worries, we understand :)

@mm1ke
Copy link
Contributor Author

mm1ke commented Aug 25, 2022

@grossmj this happens with 2.2.x

@grossmj grossmj linked a pull request Aug 27, 2022 that will close this issue
@grossmj
Copy link
Member

grossmj commented Aug 27, 2022

Fixed for both 3.0 and 2.2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants