MCPcopy Index your code
hub / github.com/ipython/ipython / _run_edit_test

Function _run_edit_test

tests/test_magic.py:1757–1775  ·  view source on GitHub ↗
(
    arg_s, exp_filename=None, exp_lineno=-1, exp_contents=None, exp_is_temp=None
)

Source from the content-addressed store, hash-verified

1755
1756
1757def _run_edit_test(
1758 arg_s, exp_filename=None, exp_lineno=-1, exp_contents=None, exp_is_temp=None
1759):
1760 ip = get_ipython()
1761 M = code.CodeMagics(ip)
1762 last_call = ["", ""]
1763 opts, args = M.parse_options(arg_s, "prxn:")
1764 filename, lineno, is_temp = M._find_edit_target(ip, args, opts, last_call)
1765
1766 if exp_filename is not None:
1767 assert exp_filename == filename
1768 if exp_contents is not None:
1769 with io.open(filename, "r", encoding="utf-8") as f:
1770 contents = f.read()
1771 assert exp_contents == contents
1772 if exp_lineno != -1:
1773 assert exp_lineno == lineno
1774 if exp_is_temp is not None:
1775 assert exp_is_temp == is_temp
1776
1777
1778def test_edit_interactive():

Callers 3

test_edit_interactiveFunction · 0.85
test_edit_cellFunction · 0.85
test_edit_fnameFunction · 0.85

Calls 4

_find_edit_targetMethod · 0.95
get_ipythonFunction · 0.90
parse_optionsMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…