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 @@ def test_findlabels(self):
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:

View file

@ -299,6 +299,7 @@ Dave Chambers
Pascal Chambon
Nicholas Chammas
Ofey Chan
Juhi Chandalia
John Chandler
Hye-Shik Chang
Jeffrey Chang