From 0022cb67e5fc9cda37c9fe45e364b2376a3e896e Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 6 Jul 2026 10:31:33 +0300 Subject: [PATCH] chore: pass explicit validate= to root Container constructions Future-proofs the suite and README against the upcoming UnvalidatedContainerWarning (FutureWarning) that modern-di 2.x will emit when a root container is built without an explicit validate argument, and dogfoods graph validation. 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 d525a95..bfed51f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ from app.services import EmailClient @pytest.fixture def di_container() -> typing.Iterator[modern_di.Container]: - with modern_di.Container(groups=ioc.ALL_GROUPS) as container: + with modern_di.Container(groups=ioc.ALL_GROUPS, validate=True) as container: yield container diff --git a/tests/conftest.py b/tests/conftest.py index cf1a4ce..032d8c7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,7 +8,7 @@ @pytest.fixture def di_container() -> typing.Iterator[modern_di.Container]: - with modern_di.Container(groups=[Dependencies, ExtraDependencies]) as container: + with modern_di.Container(groups=[Dependencies, ExtraDependencies], validate=True) as container: yield container