Skip to content

Commit 6407917

Browse files
committed
@pcrespov use setenvs_from_dict
1 parent 73ced02 commit 6407917

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

services/web/server/tests/unit/with_dbs/01/test_api_keys.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from models_library.products import ProductName
1616
from pytest_mock import MockerFixture
1717
from pytest_simcore.helpers.assert_checks import assert_status
18+
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
1819
from pytest_simcore.helpers.typing_env import EnvVarsDict
1920
from pytest_simcore.helpers.webserver_login import NewUser, UserInfoDict
2021
from servicelib.aiohttp import status
@@ -226,11 +227,12 @@ async def app_environment(
226227
app_environment: EnvVarsDict,
227228
monkeypatch: pytest.MonkeyPatch,
228229
) -> EnvVarsDict:
229-
webserver_garbage_collector = '{"GARBAGE_COLLECTOR_INTERVAL_S": 30, "GARBAGE_COLLECTOR_PRUNE_APIKEYS_INTERVAL_S": 1}'
230-
monkeypatch.setenv("WEBSERVER_GARBAGE_COLLECTOR", webserver_garbage_collector)
231-
return app_environment | {
232-
"WEBSERVER_GARBAGE_COLLECTOR": webserver_garbage_collector
233-
}
230+
return app_environment | setenvs_from_dict(
231+
monkeypatch,
232+
{
233+
"WEBSERVER_GARBAGE_COLLECTOR": '{"GARBAGE_COLLECTOR_INTERVAL_S": 30, "GARBAGE_COLLECTOR_PRUNE_APIKEYS_INTERVAL_S": 1}'
234+
},
235+
)
234236

235237

236238
async def test_prune_expired_api_keys_task_is_triggered(

0 commit comments

Comments
 (0)