Skip to content

Commit

Permalink
Replace lifespan AsyncIterator by AsyncGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse committed Jan 17, 2023
1 parent d60f9b8 commit 2c05463
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_router_events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from contextlib import asynccontextmanager
from typing import AsyncIterator, Dict
from typing import AsyncGenerator, Dict

import pytest
from fastapi import APIRouter, FastAPI
Expand Down Expand Up @@ -85,7 +85,7 @@ def sub_router_shutdown() -> None:

def test_app_lifespan_state(state: State) -> None:
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[None]:
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
state.app_startup = True
yield
state.app_shutdown = True
Expand Down

0 comments on commit 2c05463

Please sign in to comment.