(tmp_path)
| 41 | |
| 42 | @mock.patch.dict(os.environ, {}, clear=True) |
| 43 | def test_ipython_new_variable(tmp_path): |
| 44 | from IPython.terminal.embed import InteractiveShellEmbed |
| 45 | |
| 46 | dotenv_file = tmp_path / ".env" |
| 47 | dotenv_file.write_text("a=b\n") |
| 48 | os.chdir(str(tmp_path)) |
| 49 | |
| 50 | ipshell = InteractiveShellEmbed() |
| 51 | ipshell.run_line_magic("load_ext", "dotenv") |
| 52 | ipshell.run_line_magic("dotenv", "") |
| 53 | |
| 54 | assert os.environ == {"a": "b"} |
nothing calls this directly
no outgoing calls
no test coverage detected