diff --git a/examples/example.py b/examples/example.py index 53a2fe45..e085c673 100644 --- a/examples/example.py +++ b/examples/example.py @@ -3,17 +3,9 @@ """ import asyncio -import sys - -import uvicorn -from fastapi import FastAPI -from loguru import logger from findmyorder import FindMyOrder -logger.remove() -logger.add(sys.stderr, level="INFO") - async def main(): """Main""" @@ -45,26 +37,5 @@ async def main(): await asyncio.sleep(7200) -app = FastAPI() - - -@app.on_event("startup") -async def start(): - """startup""" - asyncio.create_task(main()) - - -@app.get("/") -def read_root(): - """root""" - return {"FMO is online"} - - -@app.get("/health") -def health_check(): - """healthcheck""" - return {"FMO is online"} - - if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8080) + asyncio.run(main()) diff --git a/pyproject.toml b/pyproject.toml index b815334b..b938a503 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ overgeneral-exceptions = [ [tool.poetry.group.test.dependencies] pytest = "^7.0" pytest-cov = "^4.1" -pytest-asyncio = "^0.21.0" +pytest-asyncio = "^0.22.0" pytest-mock = "^3.11.1" pytest-loguru = "^0.3.0"