Visitar URL original
Update opcode, dis from 3.14.2 by youknowone · Pull Request #6869 · RustPython/RustPython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
mark test_dis failures
  • Loading branch information
youknowone committed Jan 26, 2026
commit 4b823ebaf5f5eea63a9acbb1cb2b773cd7086b08
2 changes: 0 additions & 2 deletions Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,6 @@ def save_caller_frame():
func(save_caller_frame)
self.assertEqual(frame.f_lineno-frame.f_code.co_firstlineno, lastline)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_lineno_after_no_code(self):
def no_code1():
"doc string"
Expand Down
13 changes: 5 additions & 8 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ def test__try_compile_no_context_exc_on_error(self):
except Exception as e:
self.assertIsNone(e.__context__)

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: No END_ASYNC_FOR in disassembly of async for
def test_async_for_presentation(self):

async def afunc():
Expand Down Expand Up @@ -1474,6 +1475,10 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
dis.disassemble(func, lasti, file=output, **kwargs)
return output.getvalue()

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: No END_ASYNC_FOR in disassembly of async for
def test_async_for_presentation(self):
return super().test_async_for_presentation()


if dis.code_info.__doc__ is None:
code_info_consts = "0: None"
Expand Down Expand Up @@ -1998,12 +2003,10 @@ def test_instruction_str(self):
for instr in instrs:
str(instr)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_default_first_line(self):
actual = dis.get_instructions(simple)
self.assertInstructionsEqual(list(actual), expected_opinfo_simple)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_first_line_set_to_None(self):
actual = dis.get_instructions(simple, first_line=None)
self.assertInstructionsEqual(list(actual), expected_opinfo_simple)
Expand Down Expand Up @@ -2340,7 +2343,6 @@ def test_explicit_first_line(self):
actual = dis.Bytecode(outer, first_line=expected_outer_line)
self.assertInstructionsEqual(list(actual), expected_opinfo_outer)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_source_line_in_disassembly(self):
# Use the line in the source code
actual = dis.Bytecode(simple).dis()
Expand Down Expand Up @@ -2385,28 +2387,24 @@ def test_bytecode_co_positions(self):
assert instr.positions == positions

class TestBytecodeTestCase(BytecodeTestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON; RETURN_VALUE
def test_assert_not_in_with_op_not_in_bytecode(self):
code = compile("a = 1", "<string>", "exec")
self.assertInBytecode(code, "LOAD_SMALL_INT", 1)
self.assertNotInBytecode(code, "LOAD_NAME")
self.assertNotInBytecode(code, "LOAD_NAME", "a")

@unittest.expectedFailure # TODO: RUSTPYTHON; RETURN_VALUE
def test_assert_not_in_with_arg_not_in_bytecode(self):
code = compile("a = 1", "<string>", "exec")
self.assertInBytecode(code, "LOAD_SMALL_INT")
self.assertInBytecode(code, "LOAD_SMALL_INT", 1)
self.assertNotInBytecode(code, "LOAD_CONST", 2)

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: AssertionError not raised
def test_assert_not_in_with_arg_in_bytecode(self):
code = compile("a = 1", "<string>", "exec")
with self.assertRaises(AssertionError):
self.assertNotInBytecode(code, "LOAD_SMALL_INT", 1)

class TestFinderMethods(unittest.TestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON
def test__find_imports(self):
cases = [
("import a.b.c", ('a.b.c', 0, None)),
Expand Down Expand Up @@ -2611,7 +2609,6 @@ def test_show_cache(self):
for flag in ['-C', '--show-caches']:
self.check_output(source, expect, flag)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_show_offsets(self):
# test 'python -m dis -O/--show-offsets'
source = 'pass'
Expand Down
Loading