(tmp_path)
| 174 | |
| 175 | |
| 176 | def 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 | |
| 189 | def test_run_with_existing_variable_not_overridden(tmp_path): |