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

Function test_timeit_special_syntax

tests/test_magic.py:888–901  ·  view source on GitHub ↗

Test %%timeit with IPython special syntax

()

Source from the content-addressed store, hash-verified

886
887
888def test_timeit_special_syntax():
889 "Test %%timeit with IPython special syntax"
890
891 @register_line_magic
892 def lmagic(line):
893 ip = get_ipython()
894 ip.user_ns["lmagic_out"] = line
895
896 # line mode test
897 _ip.run_line_magic("timeit", "-n1 -r1 %lmagic my line")
898 assert _ip.user_ns["lmagic_out"] == "my line"
899 # cell mode test
900 _ip.run_cell_magic("timeit", "-n1 -r1", "%lmagic my line2")
901 assert _ip.user_ns["lmagic_out"] == "my line2"
902
903
904def test_timeit_return():

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…