mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-45578: add a test case for dis.findlabels
(GH-30058)
This commit is contained in:
parent
6e5a193816
commit
84f093918a
1 changed files with 10 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue