File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,10 @@ def app_environment(
1818 app_environment : EnvVarsDict ,
1919 external_envfile_dict : EnvVarsDict ,
2020) -> EnvVarsDict :
21- """
22- NOTE: To run against repo.config in osparc-config repo
21+ """OVERRIDES app_environment fixture:
2322
24- ln -s /path/to/osparc-config/deployments/mydeploy.com/ repo.config .secrets
25- pytest --external-envfile=.secrets tests/unit/test_core_settings.py
23+ Enables using external envfiles (e.g. repo.config files) to run tests against
24+ within this test module.
2625 """
2726 if external_envfile_dict :
2827 delenvs_from_dict (monkeypatch , app_environment , raising = False )
Original file line number Diff line number Diff line change 99import pytest
1010from pydantic import ValidationError
1111from pytest_simcore .helpers .monkeypatch_envs import (
12+ delenvs_from_dict ,
1213 setenvs_from_dict ,
1314 setenvs_from_envfile ,
1415)
1516from pytest_simcore .helpers .typing_env import EnvVarsDict
1617from simcore_service_director .core .settings import ApplicationSettings
1718
1819
19- def test_valid_web_application_settings (app_environment : EnvVarsDict ):
20+ @pytest .fixture
21+ def app_environment (
22+ monkeypatch : pytest .MonkeyPatch ,
23+ app_environment : EnvVarsDict ,
24+ external_envfile_dict : EnvVarsDict ,
25+ ) -> EnvVarsDict :
26+ """OVERRIDES app_environment fixture:
27+
28+ Enables using external envfiles (e.g. repo.config files) to run tests against
29+ within this test module.
30+ """
31+ if external_envfile_dict :
32+ delenvs_from_dict (monkeypatch , app_environment , raising = False )
33+ return setenvs_from_dict (
34+ monkeypatch ,
35+ {** external_envfile_dict },
36+ )
37+ return app_environment
38+
39+
40+ def test_valid_application_settings (app_environment : EnvVarsDict ):
2041 """
2142 We validate actual envfiles (e.g. repo.config files) by passing them via the CLI
2243
You can’t perform that action at this time.
0 commit comments