MCPcopy Create free account
hub / github.com/ipython/ipython / test_notebook_export_json

Function test_notebook_export_json

IPython/core/tests/test_magic.py:735–743  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

733
734
735def test_notebook_export_json():
736 _ip = get_ipython()
737 _ip.history_manager.reset() # Clear any existing history.
738 cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"]
739 for i, cmd in enumerate(cmds, start=1):
740 _ip.history_manager.store_inputs(i, cmd)
741 with TemporaryDirectory() as td:
742 outfile = os.path.join(td, "nb.ipynb")
743 _ip.magic("notebook -e %s" % outfile)
744
745
746class TestEnv(TestCase):

Callers

nothing calls this directly

Calls 4

get_ipythonFunction · 0.90
store_inputsMethod · 0.80
resetMethod · 0.45
magicMethod · 0.45

Tested by

no test coverage detected