Skip to content

Simplify configuration of session-scoped loops #676

Closed
@seifertm

Description

@seifertm

Pytest-asyncio users with a session-scoped event loop would have to add pytestmark = pytest.mark.asyncio(scope="session") for every package and subpackage to address the deprecation of event_loop fixture overrides (see discussion in #670).

This solution only applies to users that actually use test packages. Users that don't use test packages would have to add __init__.py files first or add pytestmark = pytest.mark.asyncio(scope="session") to each test module.

The goal of this issue is to have a more convenient way to configure session-scoped loops. Possible solutions:

  • a configuration fixture
  • a config option to set the default loop scope (mentioned previously, but I cannot find the reference)
  • a config option to set the default test scope
  • a pytest hook

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions