Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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