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

Method test_jump_threading

Lib/test/test_patma.py:3390–3406  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3388
3389class TestSourceLocations(unittest.TestCase):
3390 def test_jump_threading(self):
3391 # See gh-123048
3392 def f():
3393 x = 0
3394 v = 1
3395 match v:
3396 case 1:
3397 if x < 0:
3398 x = 1
3399 case 2:
3400 if x < 0:
3401 x = 1
3402 x += 1
3403
3404 for inst in dis.get_instructions(f):
3405 if inst.opcode in dis.hasjump:
3406 self.assertIsNotNone(inst.positions.lineno, "jump without location")
3407
3408class TestTracing(unittest.TestCase):
3409

Callers

nothing calls this directly

Calls 2

get_instructionsMethod · 0.80
assertIsNotNoneMethod · 0.80

Tested by

no test coverage detected