Skip to content

Commit a50880e

Browse files
authored
Update test_code.py to 3.14.5 (RustPython#8054)
* Update `test_code.py` to 3.14.5 * skip flakey ci test
1 parent c864885 commit a50880e

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Lib/test/test_code.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
from test.support import threading_helper, import_helper
216216
from test.support.bytecode_helper import instructions_with_positions
217217
from opcode import opmap, opname
218-
try:
218+
try: # TODO: RUSTPYTHON
219219
from _testcapi import code_offset_to_line
220220
except ModuleNotFoundError:
221221
code_offset_to_line = None
@@ -427,8 +427,7 @@ def func():
427427
new_code = code = func.__code__.replace(co_linetable=b'')
428428
self.assertEqual(list(new_code.co_lines()), [])
429429

430-
# TODO: RUSTPYTHON; co_lnotab intentionally not implemented (deprecated since 3.12)
431-
@unittest.expectedFailure
430+
@unittest.expectedFailure # TODO: RUSTPYTHON; co_lnotab intentionally not implemented (deprecated since 3.12)
432431
def test_co_lnotab_is_deprecated(self): # TODO: remove in 3.14
433432
def func():
434433
pass
@@ -491,8 +490,7 @@ def spam9():
491490
res = _testinternalcapi.code_returns_only_none(func.__code__)
492491
self.assertFalse(res)
493492

494-
# TODO: RUSTPYTHON; replace() rejects invalid bytecodes for safety
495-
@unittest.expectedFailure
493+
@unittest.expectedFailure # TODO: RUSTPYTHON; replace() rejects invalid bytecodes for safety
496494
def test_invalid_bytecode(self):
497495
def foo():
498496
pass
@@ -508,7 +506,7 @@ def foo():
508506
with self.assertRaisesRegex(SystemError, msg):
509507
foo()
510508

511-
# @requires_debug_ranges()
509+
@requires_debug_ranges()
512510
def test_co_positions_artificial_instructions(self):
513511
import dis
514512

@@ -1491,7 +1489,7 @@ async def async_func():
14911489

14921490
rc, out, err = assert_python_ok('-OO', '-c', code)
14931491

1494-
@unittest.skipUnless(code_offset_to_line, '_testcapi required')
1492+
@unittest.expectedFailureIf(code_offset_to_line is None, "TODO: RUSTPYTHON")
14951493
def test_co_branches(self):
14961494

14971495
def get_line_branches(func):

Lib/test/test_thread.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def test_nt_and_posix_stack_size(self):
115115

116116
thread.stack_size(0)
117117

118+
@unittest.skipIf(__import__("sys").platform == "linux", "TODO: RUSTPYTHON; Flakey on CI")
118119
def test__count(self):
119120
# Test the _count() function.
120121
orig = thread._count()

0 commit comments

Comments
 (0)