From fce1dd7173aa5f775df13f8561c83292c597754b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez?= Date: Fri, 10 May 2024 11:51:31 +0100 Subject: [PATCH] [ADD] test --- tests/test_router_circular_import.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/test_router_circular_import.py diff --git a/tests/test_router_circular_import.py b/tests/test_router_circular_import.py new file mode 100644 index 0000000000..a1c1d4c8d0 --- /dev/null +++ b/tests/test_router_circular_import.py @@ -0,0 +1,10 @@ +import pytest +from fastapi import FastAPI, APIRouter + +def test_router_circular_import(): + app = FastAPI() + router = APIRouter() + + app.include_router(router) + with pytest.raises(AssertionError, match="Router cannot be the same as parent"): + router.include_router(router) \ No newline at end of file