Browse Source
Co-authored-by: Javier Sánchez <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Motov Yurii <[email protected]>pull/14884/head
committed by
GitHub
2 changed files with 16 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||||
|
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) |
||||
Loading…
Reference in new issue