MCPcopy Index your code
hub / github.com/python/cpython / test_comprehension

Method test_comprehension

Lib/test/test_capi/test_opt.py:683–692  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

681 self.assertEqual(len(guard_tos_count), 1)
682
683 def test_comprehension(self):
684 def testfunc(n):
685 for _ in range(n):
686 return [i for i in range(n)]
687
688 res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
689 self.assertEqual(res, list(range(TIER2_THRESHOLD)))
690 self.assertIsNotNone(ex)
691 uops = get_opnames(ex)
692 self.assertNotIn("_BINARY_OP_ADD_INT", uops)
693
694 def test_call_py_exact_args_disappearing(self):
695 def dummy(x):

Callers

nothing calls this directly

Calls 6

_run_with_optimizerMethod · 0.95
listClass · 0.85
get_opnamesFunction · 0.85
assertIsNotNoneMethod · 0.80
assertNotInMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected