🐛 fix(conftest.py): fix client_fixture to properly yield the TestClient instance and clear dependency overrides after usage

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-05 22:18:45 -03:00
commit 7b2827f198

View file

@ -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()