diff --git a/test_books_crud.py b/test_books_crud.py index 4f93393..00160d5 100644 --- a/test_books_crud.py +++ b/test_books_crud.py @@ -16,8 +16,8 @@ async def startup_event(): @app.on_event("shutdown") async def shutdown_event(): - app.mongodb_client.close() app.database.drop_collection("books") + app.mongodb_client.close() def test_create_book(): with TestClient(app) as client: