Skip to content

Commit

Permalink
Docs: Replaced @pytest.fixture by @pytest_asyncio.fixture in the …
Browse files Browse the repository at this point in the history
…REAMDE.md examples (#52)

Co-authored-by: NetSmash <netsmash@localhost>
  • Loading branch information
netsmash and NetSmash committed Sep 24, 2022
1 parent 8ef110d commit a58b82c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ pip install asgi-lifespan httpx starlette pytest pytest-asyncio
# test_app.py
import httpx
import pytest
import pytest_asyncio
from asgi_lifespan import LifespanManager
from starlette.applications import Starlette
from starlette.responses import PlainTextResponse
from starlette.routing import Route


@pytest.fixture
@pytest_asyncio.fixture
async def app():
async def startup():
print("Starting up")
Expand All @@ -103,7 +104,7 @@ async def app():
yield app


@pytest.fixture
@pytest_asyncio.fixture
async def client(app):
async with httpx.AsyncClient(app=app, base_url="http://app.io") as client:
print("Client is ready")
Expand Down

0 comments on commit a58b82c

Please sign in to comment.