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

Function test_prun_special_syntax

IPython/core/tests/test_magic.py:694–706  ·  view source on GitHub ↗

Test %%prun with IPython special syntax

()

Source from the content-addressed store, hash-verified

692
693@dec.skipif(execution.profile is None)
694def test_prun_special_syntax():
695 "Test %%prun with IPython special syntax"
696 @register_line_magic
697 def lmagic(line):
698 ip = get_ipython()
699 ip.user_ns['lmagic_out'] = line
700
701 # line mode test
702 _ip.run_line_magic('prun', '-q %lmagic my line')
703 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line')
704 # cell mode test
705 _ip.run_cell_magic('prun', '-q', '%lmagic my line2')
706 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line2')
707
708@dec.skipif(execution.profile is None)
709def test_prun_quotes():

Callers

nothing calls this directly

Calls 2

run_line_magicMethod · 0.80
run_cell_magicMethod · 0.80

Tested by

no test coverage detected