diff options
author | Juhi Chandalia <jkchandalia@gmail.com> | 2023-04-25 21:23:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 21:23:35 (GMT) |
commit | 86aa8a5e98e5742bb5bb6ab617f08b1679b33b55 (patch) | |
tree | e1406b368647fe057596f84a75c432d0af3c049b | |
parent | ef25febcf2ede92a03c5ea00a13e167e0b5cb274 (diff) | |
download | cpython-86aa8a5e98e5742bb5bb6ab617f08b1679b33b55.zip cpython-86aa8a5e98e5742bb5bb6ab617f08b1679b33b55.tar.gz cpython-86aa8a5e98e5742bb5bb6ab617f08b1679b33b55.tar.bz2 |
GH-103804: Add test for dis.findlinestarts (#103806)
-rw-r--r-- | Lib/test/test_dis.py | 8 | ||||
-rw-r--r-- | Misc/ACKS | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 2d5c73c..9796072 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -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: @@ -299,6 +299,7 @@ Dave Chambers Pascal Chambon Nicholas Chammas Ofey Chan +Juhi Chandalia John Chandler Hye-Shik Chang Jeffrey Chang |