Skip to content

Tests: pytest emits deprecation warning #189

@elliot-100

Description

@elliot-100

Running tests gives this warning, e.g. from Actions:

Run poetry run pytest
/home/runner/work/Spond/Spond/.venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:207: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))

Note that this is rather hidden in Actions output - it may be possible to configure the pytest CI step so warnings are highlighted, as the ruff steps already do. (Edit: Pytest publishes a plugin to do this: https://github.com/pytest-dev/pytest-github-actions-annotate-failures?tab=readme-ov-file#warning-annotations)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggithub_actionsPull requests that update GitHub Actions code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions