mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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 @@ 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue