def test_hist_pof():
    ip = get_ipython()
    ip.run_cell(u'1+2', store_history=True)
    with TemporaryDirectory() as td:
        tf = os.path.join(td, 'hist.py')
        ip.run_line_magic('history', ('-pof %s' % tf))
        assert os.path.isfile(tf)
def test_hist_pof():
    ip = get_ipython()
    ip.run_cell(u'1+2', store_history=True)
    with TemporaryDirectory() as td:
        tf = os.path.join(td, 'hist.py')
        ip.run_line_magic('history', ('-pof %s' % tf))
        assert os.path.isfile(tf)