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

Function test_prun_special_syntax

tests/test_magic.py:953–966  ·  view source on GitHub ↗

Test %%prun with IPython special syntax

()

Source from the content-addressed store, hash-verified

951
952@dec.skipif(execution.profile is None)
953def test_prun_special_syntax():
954 "Test %%prun with IPython special syntax"
955
956 @register_line_magic
957 def lmagic(line):
958 ip = get_ipython()
959 ip.user_ns["lmagic_out"] = line
960
961 # line mode test
962 _ip.run_line_magic("prun", "-q %lmagic my line")
963 assert _ip.user_ns["lmagic_out"] == "my line"
964 # cell mode test
965 _ip.run_cell_magic("prun", "-q", "%lmagic my line2")
966 assert _ip.user_ns["lmagic_out"] == "my line2"
967
968
969@dec.skipif(execution.profile is None)

Callers

nothing calls this directly

Calls 2

run_line_magicMethod · 0.80
run_cell_magicMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…