mirror of https://github.com/python/cpython
bpo-45578: add a test case for `dis.findlabels` (GH-30058)
This commit is contained in:
parent
6e5a193816
commit
84f093918a
|
@ -1462,6 +1462,16 @@ class TestFinderMethods(unittest.TestCase):
|
|||
res = tuple(dis._find_store_names(code))
|
||||
self.assertEqual(res, expected)
|
||||
|
||||
def test_findlabels(self):
|
||||
labels = dis.findlabels(jumpy.__code__.co_code)
|
||||
jumps = [
|
||||
instr.offset
|
||||
for instr in expected_opinfo_jumpy
|
||||
if instr.is_jump_target
|
||||
]
|
||||
|
||||
self.assertEqual(sorted(labels), sorted(jumps))
|
||||
|
||||
|
||||
class TestDisTraceback(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
|
|
Loading…
Reference in New Issue