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

Method test_jump_threading

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

get_instructionsMethod · 0.80
assertIsNotNoneMethod · 0.80

Tested by

no test coverage detected