File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
services/director-v2/tests Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -196,17 +196,6 @@ def mock_env(
196196 )
197197
198198
199- @pytest .fixture ()
200- async def client (mock_env : EnvVarsDict ) -> AsyncIterator [TestClient ]:
201- settings = AppSettings .create_from_envs ()
202- app = init_app (settings )
203- print ("Application settings\n " , settings .model_dump_json (indent = 2 ))
204- # NOTE: this way we ensure the events are run in the application
205- # since it starts the app on a test server
206- with TestClient (app , raise_server_exceptions = True ) as test_client :
207- yield test_client
208-
209-
210199@pytest .fixture ()
211200async def initialized_app (mock_env : EnvVarsDict ) -> AsyncIterable [FastAPI ]:
212201 settings = AppSettings .create_from_envs ()
@@ -216,6 +205,14 @@ async def initialized_app(mock_env: EnvVarsDict) -> AsyncIterable[FastAPI]:
216205 yield app
217206
218207
208+ @pytest .fixture ()
209+ async def client (initialized_app : FastAPI ) -> AsyncIterator [TestClient ]:
210+ # NOTE: this way we ensure the events are run in the application
211+ # since it starts the app on a test server
212+ with TestClient (initialized_app , raise_server_exceptions = True ) as test_client :
213+ yield test_client
214+
215+
219216@pytest .fixture ()
220217async def async_client (initialized_app : FastAPI ) -> AsyncIterable [httpx .AsyncClient ]:
221218 async with httpx .AsyncClient (
You can’t perform that action at this time.
0 commit comments