mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix(configs): Update pydantic settings in config files (#6023)
This commit is contained in:
@@ -21,6 +21,7 @@ def example_env_file(tmp_path, monkeypatch) -> str:
|
||||
|
||||
|
||||
def test_dify_config_undefined_entry(example_env_file):
|
||||
# NOTE: See https://github.com/microsoft/pylance-release/issues/6099 for more details about this type error.
|
||||
# load dotenv file with pydantic-settings
|
||||
config = DifyConfig(_env_file=example_env_file)
|
||||
|
||||
@@ -43,6 +44,8 @@ def test_dify_config(example_env_file):
|
||||
assert config.SENTRY_TRACES_SAMPLE_RATE == 1.0
|
||||
|
||||
|
||||
# NOTE: If there is a `.env` file in your Workspace, this test might not succeed as expected.
|
||||
# This is due to `pymilvus` loading all the variables from the `.env` file into `os.environ`.
|
||||
def test_flask_configs(example_env_file):
|
||||
flask_app = Flask('app')
|
||||
flask_app.config.from_mapping(DifyConfig(_env_file=example_env_file).model_dump())
|
||||
|
||||
Reference in New Issue
Block a user