@dec.skipif((execution.profile is None))
def test_prun_special_syntax():
 @register_line_magic
 def lmagic(line):
  ip = get_ipython()
  ip.user_ns['lmagic_out'] = line
 _ip.run_line_magic('prun', '-q %lmagic my line')
 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line')
 _ip.run_cell_magic('prun', '-q', '%lmagic my line2')
 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line2')

@ dec . skipif ( ( execution . profile is None ) ) def test_prun_special_syntax ( ) : @ register_line_magic def lmagic ( line ) : ip = get_ipython ( ) ip . user_ns [ 'lmagic_out' ] = line _ip . run_line_magic ( 'prun' , '-q %lmagic my line' ) nt . assert_equal ( _ip . user_ns [ 'lmagic_out' ] , 'my line' ) _ip . run_cell_magic ( 'prun' , '-q' , '%lmagic my line2' ) nt . assert_equal ( _ip . user_ns [ 'lmagic_out' ] , 'my line2' )
test %%prun with ipython special syntax .