failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · fastapi/fastapi
✨ Show a clear error on attempt to include router into itself Previously discussed in https://github.com/fastapi/fastapi/discussions/11424 with the PR at https://github.com/fastapi/fastapi/pull/11425 Since I made modifications in the fork of the repo, the PR was automatically closed. This PR serves to add the circular reference check again. Discussed again in https://github.com/fastapi/fastapi/discussions/14251
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
F
=================================== FAILURES ===================================
_________________________ test_router_circular_import __________________________
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?",
):
E Failed: DID NOT RAISE AssertionError
tests/test_router_circular_import.py:8: Failed
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed in 0.39s