pytest-dev / pytest-asyncio

Asyncio support for pytest
https://pytest-asyncio.readthedocs.io
Apache License 2.0
1.43k stars 152 forks source link

Fix duplication of markers in async tests #838

Closed seifertm closed 4 months ago

seifertm commented 6 months ago

Fixes #813

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.08%. Comparing base (65aa441) to head (d15c9fc).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #838 +/- ## ========================================== - Coverage 95.61% 92.08% -3.54% ========================================== Files 2 2 Lines 479 480 +1 Branches 96 96 ========================================== - Hits 458 442 -16 - Misses 12 23 +11 - Partials 9 15 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MeggyCal commented 4 months ago

Thank you for a quick fix! Alas, it didn't fix the bokeh testsuite (at least in my environment).

seifertm commented 4 months ago

@MeggyCal Can you provide a small code example that reproduces the issue? Ideally, this should go into a separate issue.

MeggyCal commented 4 months ago

Sorry, not easily, I can try next week. Anyway, it is visible in my project on the openSUSE Buildservice: https://build.opensuse.org/project/show/home:mcalabkova:branches:devel:languages:python:numeric

seifertm commented 4 months ago

@MeggyCal A quick look at the logs suggest that the tests due to the following warning:

pytest.PytestWarning: The test […] is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove the asyncio mark. If the test is not marked explicitly, check for global marks applied via 'pytestmark'.

The warning is most likely unrelated to this PR and probably not a bug either, because the warning exists for some time already.

Whether the warning is reasonable or not is an entirely different issue. I'm open for discussing this in a dedicated issue or discussion :)

MeggyCal commented 4 months ago

@seifertm I took a look in the bokeh issues and found out it is a known issue since December: https://github.com/bokeh/bokeh/issues/13578. So it is merely a consequence of openSUSE not upper-bounding dependencies and there's no need to open another issue.

Sorry for the false alarm, I just looked into this repo first and since I saw a fix for a similar-sounding issue, I didn't investigate further and just assumed wrong. Thank you very much for your help!

seifertm commented 4 months ago

Thanks for the investigation, @MeggyCal ! I hope that we can get rid of the blockers soon, which prevent users from upgrading from v0.21…