def _run_edit_test(arg_s, exp_filename=None, exp_lineno=(- 1), exp_contents=None, exp_is_temp=None):
    ip = get_ipython()
    M = code.CodeMagics(ip)
    last_call = ['', '']
    (opts, args) = M.parse_options(arg_s, 'prxn:')
    (filename, lineno, is_temp) = M._find_edit_target(ip, args, opts, last_call)
    if (exp_filename is not None):
        nt.assert_equal(exp_filename, filename)
    if (exp_contents is not None):
        with io.open(filename, 'r', encoding='utf-8') as f:
            contents = f.read()
        nt.assert_equal(exp_contents, contents)
    if (exp_lineno != (- 1)):
        nt.assert_equal(exp_lineno, lineno)
    if (exp_is_temp is not None):
        nt.assert_equal(exp_is_temp, is_temp)
def _run_edit_test(arg_s, exp_filename=None, exp_lineno=(- 1), exp_contents=None, exp_is_temp=None):
    ip = get_ipython()
    M = code.CodeMagics(ip)
    last_call = [, ]
    (opts, args) = M.parse_options(arg_s, 'prxn:')
    (filename, lineno, is_temp) = M._find_edit_target(ip, args, opts, last_call)
    if (exp_filename is not None):
        nt.assert_equal(exp_filename, filename)
    if (exp_contents is not None):
        with io.open(filename, 'r', encoding='utf-8') as f:
            contents = f.read()
        nt.assert_equal(exp_contents, contents)
    if (exp_lineno != (- 1)):
        nt.assert_equal(exp_lineno, lineno)
    if (exp_is_temp is not None):
        nt.assert_equal(exp_is_temp, is_temp)