def test_edit_interactive():
    '%edit on interactively defined objects'
    ip = get_ipython()
    n = ip.execution_count
    ip.run_cell(u'def foo(): return 1', store_history=True)
    try:
        _run_edit_test('foo')
    except code.InteractivelyDefined as e:
        nt.assert_equal(e.index, n)
    else:
        raise AssertionError('Should have raised InteractivelyDefined')
%edit on interactively defined objects
def test_edit_interactive():
    
    ip = get_ipython()
    n = ip.execution_count
    ip.run_cell(u'def foo(): return 1', store_history=True)
    try:
        _run_edit_test('foo')
    except code.InteractivelyDefined as e:
        nt.assert_equal(e.index, n)
    else:
        raise AssertionError('Should have raised InteractivelyDefined')