Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Add checks for the current line indicator
  • Loading branch information
gaogaotiantian committed Mar 27, 2023
commit e27ffc2f91bbc0831432fa64f255884f3a6a6c7f
9 changes: 7 additions & 2 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,13 @@ def f():
else:
self.fail("Can't find a CACHE entry in the function provided to do the test")

self.assertEqual(self.get_disassembly(f.__code__, lasti=op_offset, wrapper=False),
self.get_disassembly(f.__code__, lasti=cache_offset, wrapper=False))
assem_op = self.get_disassembly(f.__code__, lasti=op_offset, wrapper=False)
assem_cache = self.get_disassembly(f.__code__, lasti=cache_offset, wrapper=False)

# Make sure --> exists and points to the correct offset
self.assertRegex(assem_op, fr"-->\s+{op_offset}")
# Make sure when lasti points to cache, it shows the same disassembly
self.assertEqual(assem_op, assem_cache)


class DisWithFileTests(DisTests):
Expand Down