mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-11 23:01:30 -05:00
Co-authored-by: Javier Sánchez <javier.sanchez.castro@bookline.ai> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
13 lines
317 B
Python
13 lines
317 B
Python
import pytest
|
|
from fastapi import APIRouter
|
|
|
|
|
|
def test_router_circular_import():
|
|
router = APIRouter()
|
|
|
|
with pytest.raises(
|
|
AssertionError,
|
|
match="Cannot include the same APIRouter instance into itself. Did you mean to include a different router?",
|
|
):
|
|
router.include_router(router)
|