mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
GH-103804: Add test for dis.findlinestarts (#103806)
This commit is contained in:
parent
ef25febcf2
commit
86aa8a5e98
2 changed files with 9 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -299,6 +299,7 @@ Dave Chambers
|
|||
Pascal Chambon
|
||||
Nicholas Chammas
|
||||
Ofey Chan
|
||||
Juhi Chandalia
|
||||
John Chandler
|
||||
Hye-Shik Chang
|
||||
Jeffrey Chang
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue