From 2c62646d2fcb3be54c197011b72fc3e019e34184 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 6 Jul 2026 10:31:58 +0300 Subject: [PATCH] chore: pass explicit validate= to root Container in tests and README Future-proofs against the upcoming UnvalidatedContainerWarning in modern-di 2.x (raised when a root container omits validate) and dogfoods graph validation in the fixture and README example. Co-Authored-By: Claude Fable 5 --- README.md | 2 +- tests/conftest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8b6450..1a6d1cf 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ class Dependencies(Group): app = typer.Typer() -container = modern_di.Container(groups=[Dependencies]) +container = modern_di.Container(groups=[Dependencies], validate=True) setup_di(app, container) diff --git a/tests/conftest.py b/tests/conftest.py index 24096ee..d5715ce 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,7 +11,7 @@ @pytest.fixture def app() -> typing.Iterator[typer.Typer]: app_ = typer.Typer() - container = modern_di.Container(groups=[Dependencies]) + container = modern_di.Container(groups=[Dependencies], validate=True) modern_di_typer.setup_di(app_, container=container) yield app_ container.close_sync()