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

Function test_timeit_special_syntax

IPython/core/tests/test_magic.py:655–667  ·  view source on GitHub ↗

Test %%timeit with IPython special syntax

()

Source from the content-addressed store, hash-verified

653
654
655def test_timeit_special_syntax():
656 "Test %%timeit with IPython special syntax"
657 @register_line_magic
658 def lmagic(line):
659 ip = get_ipython()
660 ip.user_ns['lmagic_out'] = line
661
662 # line mode test
663 _ip.run_line_magic('timeit', '-n1 -r1 %lmagic my line')
664 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line')
665 # cell mode test
666 _ip.run_cell_magic('timeit', '-n1 -r1', '%lmagic my line2')
667 nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line2')
668
669def test_timeit_return():
670 """

Callers

nothing calls this directly

Calls 2

run_line_magicMethod · 0.80
run_cell_magicMethod · 0.80

Tested by

no test coverage detected