Skip to content

Error of "attached to a different loop" appears in 0.11.0 but not in 0.10.0 #154

Closed
@krizex

Description

@krizex

My testcase get the error of "attached to a different loop" in 0.11.0 but works fine in 0.10.0

The detail is I have the following code in my testcase:

asyncio.get_event_loop().run_in_executor(...)

Is there any related change in 0.11.0?

A simple testcase for reproducing:

import asyncio
import pytest

@pytest.fixture(scope='function')
async def loop():
    return asyncio.get_event_loop()

def foo():
    return 0

@pytest.mark.asyncio
async def test_async(loop):
    await loop.run_in_executor(None, foo)

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