MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / test_run_with_existing_variable

Function test_run_with_existing_variable

tests/test_cli.py:176–186  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

174
175
176def test_run_with_existing_variable(tmp_path):
177 with sh.pushd(str(tmp_path)):
178 dotenv_file = str(tmp_path / ".env")
179 with open(dotenv_file, "w") as f:
180 f.write("a=b")
181 env = dict(os.environ)
182 env.update({"LANG": "en_US.UTF-8", "a": "c"})
183
184 result = sh.dotenv("run", "printenv", "a", _env=env)
185
186 assert result == "b\n"
187
188
189def test_run_with_existing_variable_not_overridden(tmp_path):

Callers

nothing calls this directly

Calls 1

dotenvMethod · 0.80

Tested by

no test coverage detected