From 9f49dfda2563c1f8f83ad4fa18028b31c26bc397 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 6 Jul 2026 10:31:48 +0300 Subject: [PATCH] chore: pass explicit validate= to root Container() in tests modern-di's next 2.x minor will warn (UnvalidatedContainerWarning, FutureWarning) when a root container is built without an explicit validate argument. Set validate=True at both root Container() call sites to future-proof the suite against that warning and dogfood graph validation. Co-Authored-By: Claude Fable 5 --- tests/conftest.py | 2 +- tests/test_faststream_di.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 8e50e6b..dfa84d5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,5 +10,5 @@ @pytest.fixture async def app() -> faststream.FastStream: app_ = faststream.FastStream(NatsBroker()) - setup_di(app_, container=Container(groups=[Dependencies])) + setup_di(app_, container=Container(groups=[Dependencies], validate=True)) return app_ diff --git a/tests/test_faststream_di.py b/tests/test_faststream_di.py index d0b5bb3..0f4328f 100644 --- a/tests/test_faststream_di.py +++ b/tests/test_faststream_di.py @@ -49,7 +49,7 @@ async def index_subscriber( async def test_app_without_broker() -> None: with pytest.raises(RuntimeError, match="Broker must be defined to setup DI"): - modern_di_faststream.setup_di(faststream.FastStream(), container=Container()) + modern_di_faststream.setup_di(faststream.FastStream(), container=Container(validate=True)) def test_fetch_di_container(app: faststream.FastStream) -> None: