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

Function test_ipython_new_variable

tests/test_ipython.py:43–54  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

41
42@mock.patch.dict(os.environ, {}, clear=True)
43def 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"}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected