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

Method test_timeit

tests/test_interactiveshell.py:784–799  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

782 ip.run_cell("print(n)")
783
784 def test_timeit(self):
785 called = set()
786
787 def f(x):
788 called.add(x)
789
790 ip.push({"f": f})
791
792 with tt.AssertPrints("std. dev. of"):
793 ip.run_line_magic("timeit", "-n1 f(1)")
794 self.assertEqual(called, {-1})
795 called.clear()
796
797 with tt.AssertPrints("std. dev. of"):
798 ip.run_cell_magic("timeit", "-n1 f(2)", "f(3)")
799 self.assertEqual(called, {-2, -3})
800
801 def test_time(self):
802 called = []

Callers

nothing calls this directly

Calls 3

run_line_magicMethod · 0.80
run_cell_magicMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected