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

When using pytest_asyncio for tests, function should be decorated with pytest_asyncio.fixture #7917

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

misl6
Copy link
Member

@misl6 misl6 commented Jul 17, 2022

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

From pytest-asyncio release notes:

Starting from pytest-asyncio>=0.17, three modes are provided: auto, strict and legacy. Starting from pytest-asyncio>=0.19 the strict mode is the default.

When the mode is auto, all discovered async tests are considered asyncio-driven even if they have no @pytest.mark.asyncio marker.
All async fixtures are considered asyncio-driven as well, even if they are decorated with a regular @pytest.fixture decorator instead of dedicated @pytest_asyncio.fixture counterpart.

See: https://github.com/pytest-dev/pytest-asyncio/releases/tag/v0.19.0

@misl6 misl6 added the Component: tests/CI Tests, CI, GitHub settings label Jul 17, 2022
@misl6 misl6 added this to the 2.2.0 milestone Jul 17, 2022
@misl6 misl6 changed the title Adds pytest.ini and sets asyncio_mode to auto [WIP] Adds pytest.ini and sets asyncio_mode to auto Jul 17, 2022
@misl6 misl6 changed the title [WIP] Adds pytest.ini and sets asyncio_mode to auto When using pytest_asyncio for tests, function should be decorated with pytest_asyncio.fixture Jul 17, 2022
@misl6 misl6 merged commit 714f493 into kivy:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: tests/CI Tests, CI, GitHub settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant