committed by
GitHub
1 changed files with 1 additions and 3 deletions
@ -1,11 +1,9 @@ |
|||
import pytest |
|||
from fastapi import APIRouter, FastAPI |
|||
from fastapi import APIRouter |
|||
|
|||
|
|||
def test_router_circular_import(): |
|||
app = FastAPI() |
|||
router = APIRouter() |
|||
|
|||
app.include_router(router) |
|||
with pytest.raises(AssertionError, match="Cannot include router into itself"): |
|||
router.include_router(router) |
|||
|
|||
Loading…
Reference in new issue