mirror of https://github.com/tiangolo/fastapi.git
Update tests/test_router_circular_import.py
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
This commit is contained in:
parent
c0fee03fdf
commit
28fa21fd1a
|
|
@ -1,11 +1,9 @@
|
||||||
import pytest
|
import pytest
|
||||||
from fastapi import APIRouter, FastAPI
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
|
||||||
def test_router_circular_import():
|
def test_router_circular_import():
|
||||||
app = FastAPI()
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
app.include_router(router)
|
|
||||||
with pytest.raises(AssertionError, match="Cannot include router into itself"):
|
with pytest.raises(AssertionError, match="Cannot include router into itself"):
|
||||||
router.include_router(router)
|
router.include_router(router)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue