MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_timeit_globals_args

Method test_timeit_globals_args

Lib/test/test_timeit.py:153–162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

151 self.assertEqual(delta_time, 0)
152
153 def test_timeit_globals_args(self):
154 global _global_timer
155 _global_timer = FakeTimer()
156 t = timeit.Timer(stmt='_global_timer.inc()', timer=_global_timer)
157 self.assertRaises(NameError, t.timeit, number=3)
158 timeit.timeit(stmt='_global_timer.inc()', timer=_global_timer,
159 globals=globals(), number=3)
160 local_timer = FakeTimer()
161 timeit.timeit(stmt='local_timer.inc()', timer=local_timer,
162 globals=locals(), number=3)
163
164 def repeat(self, stmt, setup, repeat=None, number=None):
165 self.fake_timer = FakeTimer()

Callers

nothing calls this directly

Calls 5

FakeTimerClass · 0.85
globalsFunction · 0.85
localsFunction · 0.85
assertRaisesMethod · 0.45
timeitMethod · 0.45

Tested by

no test coverage detected