Skip to content

Commit

Permalink
test: use asynccontextmanager for FastAPI lifespan
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzniewski-reef committed Jan 22, 2025
1 parent 94749d2 commit 0958209
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/unit_tests/test_axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# DEALINGS IN THE SOFTWARE.


import contextlib
import re
import threading
import time
Expand Down Expand Up @@ -795,6 +796,7 @@ async def test_threaded_fastapi():
server_started = threading.Event()
server_stopped = threading.Event()

@contextlib.asynccontextmanager
async def lifespan(app):
server_started.set()
yield
Expand Down

0 comments on commit 0958209

Please sign in to comment.