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

Can't use LifespanManager with pytest-asyncio #15

Closed
florimondmanca opened this issue Oct 2, 2019 · 2 comments
Closed

Can't use LifespanManager with pytest-asyncio #15

florimondmanca opened this issue Oct 2, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@florimondmanca
Copy link
Owner

Related to agronholm/anyio#74

from asgi_lifespan import LifespanManager, Lifespan
import pytest


@pytest.fixture
async def app():
    app = Lifespan()
    async with LifespanManager(app):
        yield app


@pytest.mark.asyncio
async def test_something(app):
    pass

Running pytest tests.py fails with a KeyError.

This is an issue with anyio that is being resolved — tracking here for clarity.

@florimondmanca florimondmanca added the bug Something isn't working label Oct 2, 2019
@JayH5
Copy link

JayH5 commented Oct 21, 2019

anyio 1.2.0 was released recently and this seems to be fixed

@florimondmanca
Copy link
Owner Author

Yup, it seems so! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants