def test_notebook_export_json():
    _ip = get_ipython()
    _ip.history_manager.reset()
    cmds = [u'a=1', u'def b():\n  return a**2', u"print('noël, été', b())"]
    for (i, cmd) in enumerate(cmds, start=1):
        _ip.history_manager.store_inputs(i, cmd)
    with TemporaryDirectory() as td:
        outfile = os.path.join(td, 'nb.ipynb')
        _ip.magic(('notebook -e %s' % outfile))
def test_notebook_export_json():
    _ip = get_ipython()
    _ip.history_manager.reset()
    cmds = [u'a=1', u'def b():\n  return a**2', u"print('noël, été', b())"]
    for (i, cmd) in enumerate(cmds, start=1):
        _ip.history_manager.store_inputs(i, cmd)
    with TemporaryDirectory() as td:
        outfile = os.path.join(td, 'nb.ipynb')
        _ip.magic(('notebook -e %s' % outfile))