(tmp_path)
| 25 | |
| 26 | @mock.patch.dict(os.environ, {}, clear=True) |
| 27 | def test_ipython_existing_variable_override(tmp_path): |
| 28 | from IPython.terminal.embed import InteractiveShellEmbed |
| 29 | |
| 30 | dotenv_file = tmp_path / ".env" |
| 31 | dotenv_file.write_text("a=b\n") |
| 32 | os.chdir(str(tmp_path)) |
| 33 | os.environ["a"] = "c" |
| 34 | |
| 35 | ipshell = InteractiveShellEmbed() |
| 36 | ipshell.run_line_magic("load_ext", "dotenv") |
| 37 | ipshell.run_line_magic("dotenv", "-o") |
| 38 | |
| 39 | assert os.environ == {"a": "b"} |
| 40 | |
| 41 | |
| 42 | @mock.patch.dict(os.environ, {}, clear=True) |
nothing calls this directly
no outgoing calls
no test coverage detected