Skip to content

Commit 7ff42b1

Browse files
authored
fix: unit tests env will need clear too (#11445)
Signed-off-by: yihong0618 <[email protected]>
1 parent 4d7cfd0 commit 7ff42b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/tests/unit_tests/configs/test_dify_config.py

+4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def test_dify_config_undefined_entry(example_env_file):
3737
assert config["LOG_LEVEL"] == "INFO"
3838

3939

40+
# NOTE: If there is a `.env` file in your Workspace, this test might not succeed as expected.
41+
# This is due to `pymilvus` loading all the variables from the `.env` file into `os.environ`.
4042
def test_dify_config(example_env_file):
43+
# clear system environment variables
44+
os.environ.clear()
4145
# load dotenv file with pydantic-settings
4246
config = DifyConfig(_env_file=example_env_file)
4347

0 commit comments

Comments
 (0)