From 7b2827f198a1a505558bb1a9b6636092f3e8654d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 5 Aug 2023 22:18:45 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(conftest.py):=20fix=20client?= =?UTF-8?q?=5Ffixture=20to=20properly=20yield=20the=20TestClient=20instanc?= =?UTF-8?q?e=20and=20clear=20dependency=20overrides=20after=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 45a8f8f1f..e6cc2a855 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -114,8 +114,8 @@ def client_fixture(session: Session): app = create_app() app.dependency_overrides[get_session] = get_session_override - - yield TestClient(app) + with TestClient(app) as client: + yield client app.dependency_overrides.clear()