GH-103804: Add test for dis.findlinestarts (#103806)

This commit is contained in:
Juhi Chandalia 2023-04-25 15:23:35 -06:00 committed by GitHub
parent ef25febcf2
commit 86aa8a5e98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -1935,6 +1935,14 @@ class TestFinderMethods(unittest.TestCase):
self.assertEqual(sorted(labels), sorted(jumps))
def test_findlinestarts(self):
def func():
pass
code = func.__code__
offsets = [linestart[0] for linestart in dis.findlinestarts(code)]
self.assertEqual(offsets, [0, 2])
class TestDisTraceback(DisTestBase):
def setUp(self) -> None: