mirror of https://github.com/tiangolo/fastapi.git
[ADD] test
This commit is contained in:
parent
073828f620
commit
fce1dd7173
|
|
@ -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)
|
||||
Loading…
Reference in New Issue