Skip to content

Commit 2d3c4c8

Browse files
committed
fix: Starlette test application.
Starlette-1.0.0 removed `on_startup` and `on_shutdown` parameters from `Starlette` and `Router`, being replaced by `lifespan`. Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
1 parent 00c09a4 commit 2d3c4c8

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tests/apps/starlette_app/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ def startup():
4343
Mount("/static", StaticFiles(directory=dir_path + "/static")),
4444
]
4545

46-
starlette_server = Starlette(debug=True, routes=routes, on_startup=[startup])
46+
47+
starlette_server = Starlette(debug=True, routes=routes, lifespan=startup)

tests/apps/starlette_app/app2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def startup():
3131
starlette_server = Starlette(
3232
debug=True,
3333
routes=routes,
34-
on_startup=[startup],
34+
lifespan=startup,
3535
middleware=[
3636
Middleware(
3737
TrustedHostMiddleware,

0 commit comments

Comments
 (0)