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

Function test_macro_run

tests/test_magic.py:303–314  ·  view source on GitHub ↗

Test that we can run a multi-line macro successfully.

()

Source from the content-addressed store, hash-verified

301
302
303def test_macro_run():
304 """Test that we can run a multi-line macro successfully."""
305 ip = get_ipython()
306 ip.history_manager.reset()
307 cmds = ["a=10", "a+=1", "print(a)", "%macro test 2-3"]
308 for cmd in cmds:
309 ip.run_cell(cmd, store_history=True)
310 assert ip.user_ns["test"].value == "a+=1\nprint(a)\n"
311 with tt.AssertPrints("12"):
312 ip.run_cell("test")
313 with tt.AssertPrints("13"):
314 ip.run_cell("test")
315
316
317def test_magic_magic():

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
resetMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…