Skip to content

Commit 00949d9

Browse files
lesnik512claude
andauthored
chore: pass explicit validate=True to root Container in tests (#3)
Future-proofs the suite against the upcoming UnvalidatedContainerWarning (FutureWarning) that modern-di 2.x will emit for root containers built without an explicit validate argument, and dogfoods graph validation. Co-authored-by: Claude Fable 5 <[email protected]>
1 parent fd0563e commit 00949d9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@pytest.fixture
1313
def app() -> Starlette:
1414
app_ = Starlette()
15-
container = modern_di.Container(groups=[Dependencies])
15+
container = modern_di.Container(groups=[Dependencies], validate=True)
1616
modern_di_starlette.setup_di(app_, container=container)
1717
return app_
1818

tests/test_lifespan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def user_lifespan(app_: Starlette) -> typing.AsyncIterator[dict[str, str]]
4040
events.append("shutdown")
4141

4242
app = Starlette(lifespan=user_lifespan)
43-
container = modern_di.Container(groups=[Dependencies])
43+
container = modern_di.Container(groups=[Dependencies], validate=True)
4444
modern_di_starlette.setup_di(app, container)
4545

4646
async def read_marker(request: Request) -> JSONResponse:

0 commit comments

Comments
 (0)