From 2e1b2c0ee972caa22ae199a9064c17cc7801766b Mon Sep 17 00:00:00 2001 From: erm Date: Sun, 19 Apr 2020 23:10:41 +1000 Subject: [PATCH] Minor fixes --- mangum/lifespan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mangum/lifespan.py b/mangum/lifespan.py index 169584a8..1d8cfe5d 100644 --- a/mangum/lifespan.py +++ b/mangum/lifespan.py @@ -19,8 +19,8 @@ def __post_init__(self) -> None: self.shutdown_event: asyncio.Event = asyncio.Event() async def startup(self) -> None: - self.logger.info("Waiting for application startup.") if self.is_supported: + self.logger.info("Waiting for application startup.") await self.app_queue.put({"type": "lifespan.startup"}) await self.startup_event.wait() if self.has_error: @@ -61,7 +61,7 @@ async def send(self, message: Message) -> None: self.startup_event.set() elif message_type == "lifespan.shutdown.complete": self.shutdown_event.set() - else: # pragma: no cover + else: raise RuntimeError( f"Expected lifespan message type, received: {message_type}" )