[ADD] test

This commit is contained in:
Javier Sánchez 2024-05-10 11:51:31 +01:00
parent 073828f620
commit fce1dd7173
1 changed files with 10 additions and 0 deletions

View File

@ -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)