Skip to content

Release 0.14 breaks tests that rely on a specific event_loop_policy #168

Closed
@wouterdb

Description

@wouterdb

Problem

We have many testcases that rely on asyncio.set_event_loop_policy(AnyThreadEventLoopPolicy())
We set the event loop policy in the conftest.py, such that it is set before any tests start.

Since 0.14 these testcases produce errors

RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-109_6'.

Root cause

The change here: https://github.com/pytest-dev/pytest-asyncio/pull/164/files#diff-4d85e8313d8e67cb777137411a11ac86R80

Resets the event loop policy after the first test, breaking all the next tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions