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

Function test_macro

IPython/core/tests/test_magic.py:290–300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

288
289@dec.skip_without('sqlite3')
290def test_macro():
291 ip = get_ipython()
292 ip.history_manager.reset() # Clear any existing history.
293 cmds = ["a=1", "def b():\n return a**2", "print(a,b())"]
294 for i, cmd in enumerate(cmds, start=1):
295 ip.history_manager.store_inputs(i, cmd)
296 ip.magic("macro test 1-3")
297 nt.assert_equal(ip.user_ns["test"].value, "\n".join(cmds)+"\n")
298
299 # List macros
300 nt.assert_in("test", ip.magic("macro"))
301
302
303@dec.skip_without('sqlite3')

Callers

nothing calls this directly

Calls 4

get_ipythonFunction · 0.90
store_inputsMethod · 0.80
resetMethod · 0.45
magicMethod · 0.45

Tested by

no test coverage detected