MCPcopy Create free account
hub / github.com/ipython/ipython / test_macro_run

Function test_macro_run

IPython/core/tests/test_magic.py:304–315  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

302
303@dec.skip_without('sqlite3')
304def test_macro_run():
305 """Test that we can run a multi-line macro successfully."""
306 ip = get_ipython()
307 ip.history_manager.reset()
308 cmds = ["a=10", "a+=1", "print(a)", "%macro test 2-3"]
309 for cmd in cmds:
310 ip.run_cell(cmd, store_history=True)
311 nt.assert_equal(ip.user_ns["test"].value, "a+=1\nprint(a)\n")
312 with tt.AssertPrints("12"):
313 ip.run_cell("test")
314 with tt.AssertPrints("13"):
315 ip.run_cell("test")
316
317
318def 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