File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
services/web/server/tests/unit/with_dbs/03 Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 66
77from collections .abc import AsyncIterator
88
9- import aiopg .sa
109import pytest
10+ from pytest_simcore .helpers .monkeypatch_envs import setenvs_from_dict
11+ from pytest_simcore .helpers .typing_env import EnvVarsDict
1112from simcore_postgres_database .models .user_preferences import user_preferences_frontend
13+ from sqlalchemy .ext .asyncio import AsyncEngine
1214
1315
1416@pytest .fixture
1517async def drop_all_preferences (
16- aiopg_engine : aiopg . sa . engine . Engine ,
18+ asyncpg_engine : AsyncEngine ,
1719) -> AsyncIterator [None ]:
1820 yield
19- async with aiopg_engine . acquire () as conn :
21+ async with asyncpg_engine . connect () as conn :
2022 await conn .execute (user_preferences_frontend .delete ())
23+
24+
25+ @pytest .fixture
26+ def app_environment (
27+ monkeypatch : pytest .MonkeyPatch ,
28+ app_environment : EnvVarsDict ,
29+ ) -> EnvVarsDict :
30+ return app_environment | setenvs_from_dict (
31+ monkeypatch ,
32+ {
33+ # disable tracing for tests
34+ "TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT" : "null" ,
35+ "TRACING_OPENTELEMETRY_COLLECTOR_PORT" : "null" ,
36+ "WEBSERVER_TRACING" : "null" ,
37+ },
38+ )
You can’t perform that action at this time.
0 commit comments