Skip to content

Commit

Permalink
pythonGH-103804: Add test for dis.findlinestarts (python#103806)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkchandalia authored Apr 25, 2023
1 parent ef25feb commit 86aa8a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ Dave Chambers
Pascal Chambon
Nicholas Chammas
Ofey Chan
Juhi Chandalia
John Chandler
Hye-Shik Chang
Jeffrey Chang
Expand Down

0 comments on commit 86aa8a5

Please sign in to comment.