MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_source_line_in_disassembly

Method test_source_line_in_disassembly

Lib/test/test_dis.py:2340–2349  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2338 self.assertInstructionsEqual(list(actual), expected_opinfo_outer)
2339
2340 def test_source_line_in_disassembly(self):
2341 # Use the line in the source code
2342 actual = dis.Bytecode(simple).dis()
2343 actual = actual.strip().partition(" ")[0] # extract the line no
2344 expected = str(simple.__code__.co_firstlineno)
2345 self.assertEqual(actual, expected)
2346 # Use an explicit first line number
2347 actual = dis.Bytecode(simple, first_line=350).dis()
2348 actual = actual.strip().partition(" ")[0] # extract the line no
2349 self.assertEqual(actual, "350")
2350
2351 @unittest.expectedFailure # TODO: RUSTPYTHON
2352 def test_info(self):

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
disMethod · 0.80
partitionMethod · 0.45
stripMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected