MCPcopy
hub / github.com/encode/uvicorn / CustomReload

Class CustomReload

tests/supervisors/test_reload.py:361–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359 step = 0
360
361 class CustomReload(BaseReload):
362 def startup(self):
363 calls.append("startup")
364
365 def restart(self):
366 calls.append("restart")
367
368 def shutdown(self):
369 calls.append("shutdown")
370
371 def should_restart(self):
372 nonlocal step
373 step += 1
374 if step == 1:
375 return None
376 elif step == 2:
377 return [tmp_path / "foobar.py"]
378 else:
379 raise StopIteration()
380
381 config = Config(app="tests.test_config:asgi_app", reload=True)
382 reloader = CustomReload(config, target=run, sockets=[])

Callers 1

test_base_reloader_runFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_base_reloader_runFunction · 0.68