File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from contextlib import asynccontextmanager
33import logging
44from pathlib import Path
5+ import shutil
56import threading
67from http import HTTPStatus , cookies as HTTPCookies
78
@@ -309,12 +310,16 @@ def styles_css_file() -> Generator[None]:
309310"""
310311 path = Path (__file__ ).parent
311312 static_dir = path / "static"
313+ static_dir .mkdir ()
314+
312315 styles_file = static_dir / "styles.css"
313316 _ = styles_file .write_text (css_content , encoding = "utf-8" )
314317
315318 app .static_location = "volt/static"
319+
316320 yield
317- styles_file .unlink ()
321+
322+ shutil .rmtree (static_dir )
318323 app .static_location = None
319324
320325
@@ -345,7 +350,7 @@ async def callback():
345350 log .debug ("callback called!" )
346351 started .set ()
347352
348- app = Volt (static_location = "volt/static" , lifespan = dummy_lifespan )
353+ app = Volt (lifespan = dummy_lifespan )
349354
350355 config = uvicorn .Config (app , port = 9999 , callback_notify = callback )
351356 server = uvicorn .Server (config )
You can’t perform that action at this time.
0 commit comments