From 4e658db536f27fb0f0b6c85ff14bdeeaacd310e1 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 16:10:44 -0500 Subject: [PATCH 01/13] Downgraded skips in tests --- Lib/test/test_ast/test_ast.py | 4 +- Lib/test/test_bdb.py | 66 +++++++++---------- Lib/test/test_bytes.py | 2 - Lib/test/test_class.py | 4 +- Lib/test/test_cmd_line_script.py | 8 +-- Lib/test/test_compile.py | 1 - Lib/test/test_configparser.py | 1 - Lib/test/test_context.py | 1 - Lib/test/test_descr.py | 5 +- Lib/test/test_docxmlrpc.py | 10 +-- Lib/test/test_enum.py | 12 ++-- Lib/test/test_ftplib.py | 2 - Lib/test/test_future_stmt/test_future.py | 2 +- Lib/test/test_http_cookiejar.py | 1 - Lib/test/test_importlib/test_locks.py | 2 +- .../test_importlib/test_threaded_import.py | 2 - Lib/test/test_io.py | 3 - Lib/test/test_itertools.py | 1 - Lib/test/test_json/test_decode.py | 2 +- Lib/test/test_json/test_recursion.py | 2 +- Lib/test/test_list.py | 8 +-- Lib/test/test_logging.py | 2 - Lib/test/test_marshal.py | 6 +- Lib/test/test_poll.py | 2 +- Lib/test/test_set.py | 16 ++++- Lib/test/test_signal.py | 1 - Lib/test/test_socket.py | 31 +++------ Lib/test/test_sort.py | 3 +- Lib/test/test_sqlite3/test_dbapi.py | 3 +- Lib/test/test_sqlite3/test_regression.py | 3 - Lib/test/test_ssl.py | 1 - Lib/test/test_str.py | 5 +- Lib/test/test_subprocess.py | 2 +- Lib/test/test_tarfile.py | 1 - Lib/test/test_tempfile.py | 2 +- Lib/test/test_thread.py | 1 - Lib/test/test_threading.py | 4 +- Lib/test/test_time.py | 1 - Lib/test/test_timeout.py | 1 - Lib/test/test_weakref.py | 2 +- Lib/test/test_zipfile/test_core.py | 18 ++--- Lib/test/test_zipimport.py | 2 +- 42 files changed, 107 insertions(+), 139 deletions(-) diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py index 3ff1cea2bf..1ad05fe41e 100644 --- a/Lib/test/test_ast/test_ast.py +++ b/Lib/test/test_ast/test_ast.py @@ -2183,7 +2183,7 @@ def test_yield(self): self.expr(ast.Yield(ast.Name("x", ast.Store())), "must have Load") self.expr(ast.YieldFrom(ast.Name("x", ast.Store())), "must have Load") - @unittest.skip("TODO: RUSTPYTHON; thread 'main' panicked") + @unittest.skip('TODO: RUSTPYTHON; thread "main" panicked') def test_compare(self): left = ast.Name("x", ast.Load()) comp = ast.Compare(left, [ast.In()], []) @@ -2396,7 +2396,7 @@ def test_stdlib_validates(self): ast.MatchMapping([], [], rest="_"), ] - @unittest.skip("TODO: RUSTPYTHON; thread 'main' panicked") + @unittest.expectedFailure # TODO: RUSTPYTHON; thread 'main' panicked def test_match_validation_pattern(self): name_x = ast.Name("x", ast.Load()) for pattern in self._MATCH_PATTERNS: diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index d1c1c78686..f9ba938307 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -590,7 +590,7 @@ def fail(self, msg=None): class StateTestCase(BaseTestCase): """Test the step, next, return, until and quit 'set_' methods.""" - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_step(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -601,7 +601,7 @@ def test_step(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_step_next_on_last_statement(self): for set_type in ('step', 'next'): with self.subTest(set_type=set_type): @@ -616,8 +616,8 @@ def test_step_next_on_last_statement(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON') # AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',), ('quit',)] + @unittest.expectedFailure # TODO: RUSTPYTHON def test_stepinstr(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('stepinstr', ), @@ -627,7 +627,7 @@ def test_stepinstr(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -639,7 +639,7 @@ def test_next(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_over_import(self): code = """ def main(): @@ -654,7 +654,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_on_plain_statement(self): # Check that set_next() is equivalent to set_step() on a plain # statement. @@ -667,7 +667,7 @@ def test_next_on_plain_statement(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_in_caller_frame(self): # Check that set_next() in the caller frame causes the tracer # to stop next in the caller frame. @@ -681,7 +681,7 @@ def test_next_in_caller_frame(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_return(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -694,7 +694,7 @@ def test_return(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_return_in_caller_frame(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -706,7 +706,7 @@ def test_return_in_caller_frame(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_until(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -718,7 +718,7 @@ def test_until(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_until_with_too_large_count(self): self.expect_set = [ ('line', 2, 'tfunc_main'), break_in_func('tfunc_first'), @@ -729,7 +729,7 @@ def test_until_with_too_large_count(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_until_in_caller_frame(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -741,7 +741,7 @@ def test_until_in_caller_frame(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs @patch_list(sys.meta_path) def test_skip(self): # Check that tracing is skipped over the import statement in @@ -775,7 +775,7 @@ def test_skip_with_no_name_module(self): bdb = Bdb(skip=['anything*']) self.assertIs(bdb.is_skipped_module(None), False) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_down(self): # Check that set_down() raises BdbError at the newest frame. self.expect_set = [ @@ -784,7 +784,7 @@ def test_down(self): with TracerRun(self) as tracer: self.assertRaises(BdbError, tracer.runcall, tfunc_main) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_up(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('step', ), @@ -798,7 +798,7 @@ def test_up(self): class BreakpointTestCase(BaseTestCase): """Test the breakpoint set method.""" - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_bp_on_non_existent_module(self): self.expect_set = [ ('line', 2, 'tfunc_import'), ('break', ('/non/existent/module.py', 1)) @@ -806,7 +806,7 @@ def test_bp_on_non_existent_module(self): with TracerRun(self) as tracer: self.assertRaises(BdbError, tracer.runcall, tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_bp_after_last_statement(self): code = """ def main(): @@ -820,7 +820,7 @@ def main(): with TracerRun(self) as tracer: self.assertRaises(BdbError, tracer.runcall, tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_temporary_bp(self): code = """ def func(): @@ -844,7 +844,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_disabled_temporary_bp(self): code = """ def func(): @@ -873,7 +873,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_bp_condition(self): code = """ def func(a): @@ -894,7 +894,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_bp_exception_on_condition_evaluation(self): code = """ def func(a): @@ -914,7 +914,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_bp_ignore_count(self): code = """ def func(): @@ -936,7 +936,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_ignore_count_on_disabled_bp(self): code = """ def func(): @@ -964,7 +964,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_clear_two_bp_on_same_line(self): code = """ def func(): @@ -990,7 +990,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_clear_at_no_bp(self): self.expect_set = [ ('line', 2, 'tfunc_import'), ('clear', (__file__, 1)) @@ -1044,7 +1044,7 @@ def test_load_bps_from_previous_Bdb_instance(self): class RunTestCase(BaseTestCase): """Test run, runeval and set_trace.""" - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_run_step(self): # Check that the bdb 'run' method stops at the first line event. code = """ @@ -1057,7 +1057,7 @@ def test_run_step(self): with TracerRun(self) as tracer: tracer.run(compile(textwrap.dedent(code), '', 'exec')) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_runeval_step(self): # Test bdb 'runeval'. code = """ @@ -1080,7 +1080,7 @@ def main(): class IssuesTestCase(BaseTestCase): """Test fixed bdb issues.""" - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_step_at_return_with_no_trace_in_caller(self): # Issue #13183. # Check that the tracer does step into the caller frame when the @@ -1111,7 +1111,7 @@ def func(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_until_return_in_generator(self): # Issue #16596. # Check that set_next(), set_until() and set_return() do not treat the @@ -1153,7 +1153,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_command_in_generator_for_loop(self): # Issue #16596. code = """ @@ -1185,7 +1185,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_next_command_in_generator_with_subiterator(self): # Issue #16596. code = """ @@ -1217,7 +1217,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON; Error in atexit._run_exitfuncs') + @unittest.expectedFailure # TODO: RUSTPYTHON; Error in atexit._run_exitfuncs def test_return_command_in_generator_with_subiterator(self): # Issue #16596. code = """ @@ -1249,8 +1249,8 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - @unittest.skip('TODO: RUSTPYTHON') # AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',)] + @unittest.expectedFailure # TODO: RUSTPYTHON def test_next_to_botframe(self): # gh-125422 # Check that next command won't go to the bottom frame. diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 8f01f89030..a1a711da70 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -2138,7 +2138,6 @@ def test_join(self): s3 = s1.join([b"abcd"]) self.assertIs(type(s3), self.basetype) - @unittest.skip('TODO: RUSTPYTHON; Fails on ByteArraySubclassWithSlotsTest') def test_pickle(self): a = self.type2test(b"abcd") a.x = 10 @@ -2153,7 +2152,6 @@ def test_pickle(self): self.assertEqual(type(a.z), type(b.z)) self.assertFalse(hasattr(b, 'y')) - @unittest.skip('TODO: RUSTPYTHON; Fails on ByteArraySubclassWithSlotsTest') def test_copy(self): a = self.type2test(b"abcd") a.x = 10 diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 29215f0600..91d12a24c8 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -554,7 +554,7 @@ class Custom: self.assertFalse(hasattr(o, "__call__")) self.assertFalse(hasattr(c, "__call__")) - @unittest.skip("TODO: RUSTPYTHON, segmentation fault") + @unittest.skip('TODO: RUSTPYTHON; segmentation fault') def testSFBug532646(self): # Test for SF bug 532646 @@ -611,7 +611,6 @@ def assertNotOrderable(self, a, b): with self.assertRaises(TypeError): a >= b - @unittest.skip("TODO: RUSTPYTHON; unstable result") def testHashComparisonOfMethods(self): # Test comparison and hash of methods class A: @@ -979,7 +978,6 @@ class Bar: pass self.assertIsInstance(f, Bar) self.assertEqual(f.__dict__, {}) - @unittest.skip("TODO: RUSTPYTHON, unexpectedly long runtime") def test_store_attr_type_cache(self): """Verifies that the type cache doesn't provide a value which is inconsistent from the dict.""" diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index d2b3a7d3e4..f5973c7a9e 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -209,19 +209,19 @@ def check_repl_stderr_flush(self, separate_stderr=False): self.assertIn(b'File ""', stderr.readline()) self.assertIn(b'ZeroDivisionError', stderr.readline()) - @unittest.skip("TODO: RUSTPYTHON, test hang in middle") + @unittest.skip('TODO: RUSTPYTHON; hanging') def test_repl_stdout_flush(self): self.check_repl_stdout_flush() - @unittest.skip("TODO: RUSTPYTHON, test hang in middle") + @unittest.skip('TODO: RUSTPYTHON; hanging') def test_repl_stdout_flush_separate_stderr(self): self.check_repl_stdout_flush(True) - @unittest.skip("TODO: RUSTPYTHON, test hang in middle") + @unittest.skip('TODO: RUSTPYTHON; hanging') def test_repl_stderr_flush(self): self.check_repl_stderr_flush() - @unittest.skip("TODO: RUSTPYTHON, test hang in middle") + @unittest.skip('TODO: RUSTPYTHON; hanging') def test_repl_stderr_flush_separate_stderr(self): self.check_repl_stderr_flush(True) diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 9f6ad6879c..bbaf3c5c19 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -108,7 +108,6 @@ def __getitem__(self, key): exec('z = a', g, d) self.assertEqual(d['z'], 12) - @unittest.skip("TODO: RUSTPYTHON; segmentation fault") def test_extended_arg(self): # default: 1000 * 2.5 = 2500 repetitions repeat = int(sys.getrecursionlimit() * 2.5) diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index d793cc5890..3e2b1a8da3 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -762,7 +762,6 @@ def test_read_returns_file_list(self): parsed_files = cf.read([], encoding="utf-8") self.assertEqual(parsed_files, []) - @unittest.skip("TODO: RUSTPYTHON, suspected to make CI hang") def test_read_returns_file_list_with_bytestring_path(self): if self.delimiters[0] != '=': self.skipTest('incompatible format') diff --git a/Lib/test/test_context.py b/Lib/test/test_context.py index 06270e161d..aa83c6bbd7 100644 --- a/Lib/test/test_context.py +++ b/Lib/test/test_context.py @@ -358,7 +358,6 @@ def ctx2_fun(): ctx1.run(ctx1_fun) - @unittest.skip("TODO: RUSTPYTHON; threading is not safe") @isolated_context @threading_helper.requires_working_threading() def test_context_threads_1(self): diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index b3d973237d..daf5f0ce15 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1834,7 +1834,6 @@ def __init__(self, foo): object.__init__(A(3)) self.assertRaises(TypeError, object.__init__, A(3), 5) - @unittest.skip('TODO: RUSTPYTHON; This passes, but the `expectedFailure` here is from CPython, so this test is an "UNEXPECTED SUCCESS" (not good)') @unittest.expectedFailure def test_restored_object_new(self): class A(object): @@ -5193,7 +5192,7 @@ def __pow__(self, *args): class MiscTests(unittest.TestCase): - @unittest.skip("TODO: RUSTPYTHON; rustpython panicked at 'dict has non-string keys: [PyObject PyBaseObject]'") + @unittest.skip('TODO: RUSTPYTHON; rustpython panicked at "dict has non-string keys: [PyObject PyBaseObject]"') def test_type_lookup_mro_reference(self): # Issue #14199: _PyType_Lookup() has to keep a strong reference to # the type MRO because it may be modified during the lookup, if @@ -5640,7 +5639,7 @@ def __repr__(self): objcopy2 = deepcopy(objcopy) self._assert_is_copy(obj, objcopy2) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.skip('TODO: RUSTPYTHON; hanging') def test_issue24097(self): # Slot name is freed inside __getattr__ and is later used. class S(str): # Not interned diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index 3c05412ef5..d24b795e2c 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -119,7 +119,7 @@ def test_invalid_get_response(self): response.read() - @unittest.skip('TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response') + @unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response def test_lambda(self): """Test that lambda functionality stays the same. The output produced currently is, I suspect invalid because of the unencoded brackets in the @@ -160,9 +160,9 @@ def test_autolinking(self): b'auto-linked, too:
\n' b'http://google.com.'), response) + @unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response @make_request_and_skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") - @unittest.skip('TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response') def test_system_methods(self): """Test the presence of three consecutive system.* methods. @@ -190,7 +190,7 @@ def test_system_methods(self): b'
\nThis server does NOT support system' b'.methodSignature.'), response) - @unittest.skip('TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response') + @unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response def test_autolink_dotted_methods(self): """Test that selfdot values are made strong automatically in the documentation.""" @@ -200,7 +200,7 @@ def test_autolink_dotted_methods(self): self.assertIn(b"""Try self.add, too.""", response.read()) - @unittest.skip('TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response') + @unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response def test_annotations(self): """ Test that annotations works as expected """ self.client.request("GET", "/") @@ -214,7 +214,7 @@ def test_annotations(self): b'method_annotation(x: bytes)'), response.read()) - @unittest.skip('TODO: RUSTPYTHON; TypeError: HTMLDoc.heading() missing 2 required positional arguments: "fgcol" and "bgcol"') + @unittest.expectedFailure # TODO: RUSTPYTHON; hTypeError: HTMLDoc.heading() missing 2 required positional arguments: "fgcol" and "bgcol" def test_server_title_escape(self): # bpo-38243: Ensure that the server title and documentation # are escaped for HTML. diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index b9d9cf33e3..5a961711cc 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -445,7 +445,7 @@ def spam(cls): with self.assertRaises(AttributeError): del Season.SPRING.name - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance failed in 'BadSuper' def test_bad_new_super(self): with self.assertRaisesRegex( @@ -1923,7 +1923,7 @@ def test_wrong_inheritance_order(self): class Wrong(Enum, str): NotHere = 'error before this point' - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance INVALID in 'RgbColor' def test_raise_custom_error_on_creation(self): class InvalidRgbColorError(ValueError): @@ -2613,7 +2613,7 @@ class Test(Base2): self.assertEqual(Test.flash.flash, 'flashy dynamic') self.assertEqual(Test.flash.value, 1) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance grene in 'Color' def test_no_duplicates(self): class UniqueEnum(Enum): @@ -3000,7 +3000,7 @@ def test_empty_globals(self): local_ls = {} exec(code, global_ns, local_ls) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance one in 'FirstFailedStrEnum' def test_strenum(self): class GoodStrEnum(StrEnum): @@ -3126,7 +3126,7 @@ class ThirdFailedStrEnum(CustomStrEnum): one = '1' two = b'2', 'ascii', 9 - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance key_type in 'Combined' def test_missing_value_error(self): with self.assertRaisesRegex(TypeError, "_value_ not set in __new__"): @@ -3414,7 +3414,7 @@ def __new__(cls, c): self.assertEqual(FlagFromChar.a, 158456325028528675187087900672) self.assertEqual(FlagFromChar.a|1, 158456325028528675187087900673) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # RuntimeError: Error calling __set_name__ on '_proto_member' instance A in 'MyEnum' def test_init_exception(self): class Base: diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 684f5d438b..7c63237710 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -903,7 +903,6 @@ def retr(): retr() -@unittest.skip("TODO: RUSTPYTHON; SSL + asyncore has problem") @skipUnless(ssl, "SSL not available") @requires_subprocess() class TestTLS_FTPClassMixin(TestFTPClass): @@ -922,7 +921,6 @@ def setUp(self, encoding=DEFAULT_ENCODING): @skipUnless(ssl, "SSL not available") -@unittest.skip("TODO: RUSTPYTHON; SSL + asyncore has problem") @requires_subprocess() class TestTLS_FTPClass(TestCase): """Specific TLS_FTP class tests.""" diff --git a/Lib/test/test_future_stmt/test_future.py b/Lib/test/test_future_stmt/test_future.py index a7d649b32a..febd9fb095 100644 --- a/Lib/test/test_future_stmt/test_future.py +++ b/Lib/test/test_future_stmt/test_future.py @@ -195,7 +195,7 @@ def test_syntactical_future_repl(self): out = kill_python(p) self.assertNotIn(b'SyntaxError: invalid syntax', out) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.expectedFailure # TODO: RUSTPYTHON # SyntaxError: future feature spam is not defined def test_future_dotted_import(self): with self.assertRaises(ImportError): diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index f4b9dc6a28..68a693c78b 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -125,7 +125,6 @@ def test_http2time_garbage(self): "http2time(%s) is not None\n" "http2time(test) %s" % (test, http2time(test))) - @unittest.skip("TODO: RUSTPYTHON, regressed to cubic complexity") def test_http2time_redos_regression_actually_completes(self): # LOOSE_HTTP_DATE_RE was vulnerable to malicious input which caused catastrophic backtracking (REDoS). # If we regress to cubic complexity, this test will take a very long time to succeed. diff --git a/Lib/test/test_importlib/test_locks.py b/Lib/test/test_importlib/test_locks.py index edf0329c75..122256e270 100644 --- a/Lib/test/test_importlib/test_locks.py +++ b/Lib/test/test_importlib/test_locks.py @@ -99,7 +99,7 @@ def f(): self.assertEqual(len(results), NTHREADS) return results - @unittest.skip("TODO: RUSTPYTHON, sometimes hangs") + @unittest.skip("TODO: RUSTPYTHON, flaky test") def test_deadlock(self): results = self.run_deadlock_avoidance_test(True) # At least one of the threads detected a potential deadlock on its diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index 3ceb86cbea..462be6ba48 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -249,14 +249,12 @@ def target(): __import__(TESTFN) del sys.modules[TESTFN] - @unittest.skip("TODO: RUSTPYTHON; hang") def test_concurrent_futures_circular_import(self): # Regression test for bpo-43515 fn = os.path.join(os.path.dirname(__file__), 'partial', 'cfimport.py') script_helper.assert_python_ok(fn) - @unittest.skip("TODO: RUSTPYTHON - fails on Linux due to multiprocessing issues") def test_multiprocessing_pool_circular_import(self): # Regression test for bpo-41567 fn = os.path.join(os.path.dirname(__file__), diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 3c507c3049..ea77c7243c 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1846,7 +1846,6 @@ def test_error_through_destructor(self): def test_truncate_on_read_only(self): return super().test_truncate_on_read_only() - @unittest.skip('TODO: RUSTPYTHON; fallible allocation') def test_constructor(self): return super().test_constructor() @@ -2196,7 +2195,6 @@ def test_args_error(self): def test_error_through_destructor(self): return super().test_error_through_destructor() - @unittest.skip('TODO: RUSTPYTHON; fallible allocation') def test_constructor(self): return super().test_constructor() @@ -2695,7 +2693,6 @@ def test_args_error(self): def test_error_through_destructor(self): return super().test_error_through_destructor() - @unittest.skip('TODO: RUSTPYTHON; fallible allocation') def test_constructor(self): return super().test_constructor() diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 03dadb71f7..1c0c38ee04 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -1807,7 +1807,6 @@ def __next__(self): with self.assertRaisesRegex(RuntimeError, "tee"): next(a) - @unittest.skip("TODO: RUSTPYTHON; , hangs") @threading_helper.requires_working_threading() def test_tee_concurrent(self): start = threading.Event() diff --git a/Lib/test/test_json/test_decode.py b/Lib/test/test_json/test_decode.py index f07f7d5533..387fee8436 100644 --- a/Lib/test/test_json/test_decode.py +++ b/Lib/test/test_json/test_decode.py @@ -19,7 +19,7 @@ def test_float(self): self.assertEqual(rval, 1.0) # TODO: RUSTPYTHON - @unittest.skip("TODO: RUSTPYTHON; called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }") + @unittest.skip('TODO: RUSTPYTHON; called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }') def test_nonascii_digits_rejected(self): # JSON specifies only ascii digits, see gh-125687 for num in ["1\uff10", "0.\uff10", "0e\uff10"]: diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py index 59f6f2c4b1..4109250356 100644 --- a/Lib/test/test_json/test_recursion.py +++ b/Lib/test/test_json/test_recursion.py @@ -68,7 +68,7 @@ def default(self, o): self.fail("didn't raise ValueError on default recursion") # TODO: RUSTPYTHON - @unittest.skip("TODO: RUSTPYTHON; crashes") + @unittest.skip('TODO: RUSTPYTHON; crashes') def test_highly_nested_objects_decoding(self): # test that loading highly-nested objects doesn't segfault when C # accelerations are used. See #12017 diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py index ed061384f1..d64b4851d3 100644 --- a/Lib/test/test_list.py +++ b/Lib/test/test_list.py @@ -104,7 +104,7 @@ def test_empty_slice(self): x[:] = x self.assertEqual(x, []) - @unittest.skip("TODO: RUSTPYTHON; crash") + @unittest.skip('TODO: RUSTPYTHON; crash') def test_list_resize_overflow(self): # gh-97616: test new_allocated * sizeof(PyObject*) overflow # check in list_resize() @@ -118,7 +118,7 @@ def test_list_resize_overflow(self): with self.assertRaises((MemoryError, OverflowError)): lst *= size - @unittest.skip("TODO: RUSTPYTHON; hangs") + @unittest.skip('TODO: RUSTPYTHON; hangs') def test_repr_mutate(self): class Obj: @staticmethod @@ -227,7 +227,7 @@ class L(list): pass with self.assertRaises(TypeError): (3,) + L([1,2]) - @unittest.skip("TODO: RUSTPYTHON; hang") + @unittest.skip('TODO: RUSTPYTHON; hang') def test_equal_operator_modifying_operand(self): # test fix for seg fault reported in bpo-38588 part 2. class X: @@ -253,7 +253,7 @@ def __eq__(self, other): list4 = [1] self.assertFalse(list3 == list4) - @unittest.skip("TODO: RUSTPYTHON; hang") + @unittest.skip('TODO: RUSTPYTHON; hang') def test_lt_operator_modifying_operand(self): # See gh-120298 class evil: diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 752054b729..8ea77d186e 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1115,7 +1115,6 @@ class SMTPHandlerTest(BaseTest): # bpo-14314, bpo-19665, bpo-34092: don't wait forever TIMEOUT = support.LONG_TIMEOUT - @unittest.skip("TODO: RUSTPYTHON; hangs") def test_basic(self): sockmap = {} server = TestSMTPServer((socket_helper.HOST, 0), self.process_message, 0.001, @@ -2153,7 +2152,6 @@ def handle_request(self, request): request.end_headers() self.handled.set() - @unittest.skip('TODO: RUSTPYTHON; flaky test') def test_output(self): # The log message sent to the HTTPHandler is properly received. logger = logging.getLogger("http") diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index 2161e06b2f..3b1a97f424 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -35,7 +35,7 @@ def test_ints(self): self.helper(expected) n = n >> 1 - @unittest.skip("TODO: RUSTPYTHON; hang") + @unittest.expectedFailure # TODO: RUSTPYTHON def test_int64(self): # Simulate int marshaling with TYPE_INT64. maxint64 = (1 << 63) - 1 @@ -232,7 +232,7 @@ def check(s): self.assertRaises(ValueError, marshal.loads, s) run_tests(2**20, check) - @unittest.skip("TODO: RUSTPYTHON; segfault") + @unittest.expectedFailure # TODO: RUSTPYTHON; segfault def test_recursion_limit(self): # Create a deeply nested structure. head = last = [] @@ -498,7 +498,7 @@ def testModule(self): self.helper(code) self.helper3(code) - @unittest.skip("TODO: RUSTPYTHON") + @unittest.skip('TODO: RUSTPYTHON') def testRecursion(self): obj = 1.2345 d = {"hello": obj, "goodbye": obj, obj: "hello"} diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index a9bfb755c3..65dea94326 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -181,7 +181,7 @@ def test_poll_c_limits(self): self.assertRaises(OverflowError, pollster.poll, INT_MAX + 1) self.assertRaises(OverflowError, pollster.poll, UINT_MAX + 1) - @unittest.skip("TODO: RUSTPYTHON fd reallocation") + @unittest.skip('TODO: RUSTPYTHON; fd reallocation') @threading_helper.reap_threads def test_threaded_poll(self): r, w = os.pipe() diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 8ef2871c61..0807162681 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1809,24 +1809,29 @@ def check_set_op_does_not_crash(self, function): self.assertIn("changed size during iteration", str(e)) -@unittest.skip("TODO: RUSTPYTHON; segfault") class TestBinaryOpsMutating(TestOperationsMutating): + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_eq_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a == b) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ne_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a != b) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_lt_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a < b) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_le_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a <= b) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_gt_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a > b) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ge_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a >= b) @@ -1847,16 +1852,19 @@ def f(a, b): a &= b self.check_set_op_does_not_crash(f) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ior_with_mutation(self): def f(a, b): a |= b self.check_set_op_does_not_crash(f) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_isub_with_mutation(self): def f(a, b): a -= b self.check_set_op_does_not_crash(f) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ixor_with_mutation(self): def f(a, b): a ^= b @@ -1898,12 +1906,12 @@ class TestBinaryOpsMutating_Subclass_Set(TestBinaryOpsMutating, unittest.TestCas constructor2 = set -@unittest.skip("TODO: RUSTPYTHON; segfault") class TestMethodsMutating(TestOperationsMutating): def test_issubset_with_mutation(self): self.check_set_op_does_not_crash(set.issubset) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_issuperset_with_mutation(self): self.check_set_op_does_not_crash(set.issuperset) @@ -1919,18 +1927,22 @@ def test_difference_with_mutation(self): def test_symmetric_difference_with_mutation(self): self.check_set_op_does_not_crash(set.symmetric_difference) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_isdisjoint_with_mutation(self): self.check_set_op_does_not_crash(set.isdisjoint) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_difference_update_with_mutation(self): self.check_set_op_does_not_crash(set.difference_update) def test_intersection_update_with_mutation(self): self.check_set_op_does_not_crash(set.intersection_update) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_symmetric_difference_update_with_mutation(self): self.check_set_op_does_not_crash(set.symmetric_difference_update) + @unittest.skip('TODO: RUSTPYTHON; segfault') def test_update_with_mutation(self): self.check_set_op_does_not_crash(set.update) diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 578bee3172..2c5cec803d 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1351,7 +1351,6 @@ def handler(signum, frame): # Python handler self.assertEqual(len(sigs), N, "Some signals were lost") - @unittest.skip('TODO: RUSTPYTHON; hang') @unittest.skipIf(is_apple, "crashes due to system bug (FB13453490)") @unittest.skipUnless(hasattr(signal, "SIGUSR1"), "test needs SIGUSR1") diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 08d3dcb579..fc93b57354 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -905,8 +905,7 @@ def requireSocket(*args): class GeneralModuleTests(unittest.TestCase): @unittest.skipUnless(_socket is not None, 'need _socket module') - # TODO: RUSTPYTHON; gc.is_tracked not implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON; gc.is_tracked not implemented def test_socket_type(self): self.assertTrue(gc.is_tracked(_socket.socket)) with self.assertRaisesRegex(TypeError, "immutable"): @@ -969,8 +968,7 @@ def testSocketError(self): with self.assertRaises(OSError, msg=msg % 'socket.gaierror'): raise socket.gaierror - # TODO: RUSTPYTHON; error message format differs - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON; error message format differs def testSendtoErrors(self): # Testing that sendto doesn't mask failures. See #10169. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) @@ -2394,8 +2392,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.interface = "vcan0" - # TODO: RUSTPYTHON - J1939 constants not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - J1939 constants not fully implemented @unittest.skipUnless(hasattr(socket, "CAN_J1939"), 'socket.CAN_J1939 required for this test.') def testJ1939Constants(self): @@ -2437,8 +2434,7 @@ def testCreateJ1939Socket(self): with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: pass - # TODO: RUSTPYTHON - AF_CAN J1939 address format not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_CAN J1939 address format not fully implemented def testBind(self): try: with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: @@ -6489,8 +6485,7 @@ def remoteProcessServer(cls, q): s2.close() s.close() - # TODO: RUSTPYTHON; multiprocessing.SemLock not implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON; multiprocessing.SemLock not implemented def testShare(self): # Transfer the listening server socket to another process # and service it from there. @@ -6842,7 +6837,6 @@ def test_errors(self): @unittest.skipUnless(hasattr(os, "sendfile"), 'os.sendfile() required for this test.') -@unittest.skip("TODO: RUSTPYTHON; os.sendfile count parameter not handled correctly") class SendfileUsingSendfileTest(SendfileUsingSendTest): """ Test the sendfile() implementation of socket.sendfile(). @@ -6867,8 +6861,7 @@ def create_alg(self, typ, name): # bpo-31705: On kernel older than 4.5, sendto() failed with ENOKEY, # at least on ppc64le architecture - # TODO: RUSTPYTHON - AF_ALG not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented @support.requires_linux_version(4, 5) def test_sha256(self): expected = bytes.fromhex("ba7816bf8f01cfea414140de5dae2223b00361a396" @@ -6887,8 +6880,7 @@ def test_sha256(self): op.send(b'') self.assertEqual(op.recv(512), expected) - # TODO: RUSTPYTHON - AF_ALG not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented def test_hmac_sha1(self): # gh-109396: In FIPS mode, Linux 6.5 requires a key # of at least 112 bits. Use a key of 152 bits. @@ -6904,8 +6896,7 @@ def test_hmac_sha1(self): # Although it should work with 3.19 and newer the test blocks on # Ubuntu 15.10 with Kernel 4.2.0-19. - # TODO: RUSTPYTHON - AF_ALG not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented @support.requires_linux_version(4, 3) def test_aes_cbc(self): key = bytes.fromhex('06a9214036b8a15b512e03d534120006') @@ -6947,8 +6938,7 @@ def test_aes_cbc(self): self.assertEqual(len(dec), msglen * multiplier) self.assertEqual(dec, msg * multiplier) - # TODO: RUSTPYTHON - AF_ALG not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented @support.requires_linux_version(4, 9) # see gh-73510 def test_aead_aes_gcm(self): kernel_version = support._get_kernel_version("Linux") @@ -7018,8 +7008,7 @@ def test_aead_aes_gcm(self): res = op.recv(len(msg) - taglen) self.assertEqual(plain, res[assoclen:]) - # TODO: RUSTPYTHON - AF_ALG not fully implemented - @unittest.expectedFailure + @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented @support.requires_linux_version(4, 3) # see test_aes_cbc def test_drbg_pr_sha256(self): # deterministic random bit generator, prediction resistance, sha256 diff --git a/Lib/test/test_sort.py b/Lib/test/test_sort.py index be3d4a8461..2a86ac8c06 100644 --- a/Lib/test/test_sort.py +++ b/Lib/test/test_sort.py @@ -132,7 +132,6 @@ def bad_key(x): class TestBugs(unittest.TestCase): - @unittest.skip("TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length") def test_bug453523(self): # bug 453523 -- list.sort() crasher. # If this fails, the most likely outcome is a core dump. @@ -149,7 +148,7 @@ def __lt__(self, other): L = [C() for i in range(50)] self.assertRaises(ValueError, L.sort) - @unittest.skip("TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length") + @unittest.expectedFailure # TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length def test_undetected_mutation(self): # Python 2.4a1 did not always detect mutation memorywaster = [] diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 9a95c489a3..650069999d 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -547,7 +547,6 @@ def test_connection_init_good_isolation_levels(self): # TODO: RUSTPYTHON # @unittest.expectedFailure - @unittest.skip("TODO: RUSTPYTHON deadlock") def test_connection_reinit(self): db = ":memory:" cx = sqlite.connect(db) @@ -587,11 +586,11 @@ def test_connection_bad_reinit(self): ((v,) for v in range(3))) -@unittest.skip("TODO: RUSTPYTHON") class UninitialisedConnectionTests(unittest.TestCase): def setUp(self): self.cx = sqlite.Connection.__new__(sqlite.Connection) + @unittest.skip('TODO: RUSTPYTHON') def test_uninit_operations(self): funcs = ( lambda: self.cx.isolation_level, diff --git a/Lib/test/test_sqlite3/test_regression.py b/Lib/test/test_sqlite3/test_regression.py index d746be647c..16b8f126f0 100644 --- a/Lib/test/test_sqlite3/test_regression.py +++ b/Lib/test/test_sqlite3/test_regression.py @@ -266,7 +266,6 @@ def collation_cb(a, b): # Lone surrogate cannot be encoded to the default encoding (utf8) "\uDC80", collation_cb) - @unittest.skip("TODO: RUSTPYTHON deadlock") def test_recursive_cursor_use(self): """ http://bugs.python.org/issue10811 @@ -448,7 +447,6 @@ def test_table_lock_cursor_dealloc(self): con.execute("drop table t") con.commit() - @unittest.skip("TODO: RUSTPYTHON deadlock") def test_table_lock_cursor_non_readonly_select(self): with memory_database() as con: con.execute("create table t(t)") @@ -476,7 +474,6 @@ def test_executescript_step_through_select(self): self.assertEqual(steps, values) -@unittest.skip("TODO: RUSTPYTHON deadlock") class RecursiveUseOfCursors(unittest.TestCase): # GH-80254: sqlite3 should not segfault for recursive use of cursors. msg = "Recursive use of cursors not allowed" diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 5384e4caf6..05d2570892 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,7 +4596,6 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - @unittest.skip("TODO: rustpython") def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py index 9d43a33cd9..6b766272a3 100644 --- a/Lib/test/test_str.py +++ b/Lib/test/test_str.py @@ -565,7 +565,6 @@ def __str__(self): return self.sval self.checkraises(TypeError, ' ', 'join', [1, 2, 3]) self.checkraises(TypeError, ' ', 'join', ['1', '2', 3]) - @unittest.skip('TODO: RUSTPYTHON; oom handling') @unittest.skipIf(sys.maxsize > 2**32, 'needs too much memory on a 64-bit platform') def test_join_overflow(self): @@ -1460,7 +1459,6 @@ def __getitem__(self, key): self.assertRaises(TypeError, '{a}'.format_map, []) self.assertRaises(ZeroDivisionError, '{a}'.format_map, BadMapping()) - @unittest.skip('TODO: RUSTPYTHON; killed for chewing up RAM') def test_format_huge_precision(self): format_string = ".{}f".format(sys.maxsize + 1) with self.assertRaises(ValueError): @@ -2468,7 +2466,6 @@ def test_printable_repr(self): # This test only affects 32-bit platforms because expandtabs can only take # an int as the max value, not a 64-bit C long. If expandtabs is changed # to take a 64-bit long, this test should apply to all platforms. - @unittest.skip('TODO: RUSTPYTHON; oom handling') @unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4, 'only applies to 32-bit platforms') def test_expandtabs_overflows_gracefully(self): @@ -2479,7 +2476,7 @@ def test_expandtabs_optimization(self): s = 'abc' self.assertIs(s.expandtabs(), s) - @unittest.skip('TODO: RUSTPYTHON; aborted: memory allocation of 9223372036854775759 bytes failed') + @unittest.expectedFailure # TODO: RUSTPYTHON def test_raiseMemError(self): asciifields = "nnb" compactfields = asciifields + "nP" diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 4d05865272..af4f92f3ae 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2318,7 +2318,7 @@ def _test_extra_groups_impl(self, *, gid, group_list): extra_groups=[name_group]) # No skip necessary, this test won't make it to a setgroup() call. - @unittest.skip('TODO: RUSTPYTHON; clarify failure condition') + @unittest.expectedFailure # TODO: RUSTPYTHON def test_extra_groups_invalid_gid_t_values(self): with self.assertRaises(ValueError): subprocess.check_call(ZERO_RETURN_CMD, extra_groups=[-1]) diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index d29c691823..92ce7c32a0 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -456,7 +456,6 @@ def test_premature_end_of_archive(self): with self.assertRaisesRegex(tarfile.ReadError, "unexpected end of data"): tar.extractfile(t).read() - @unittest.skip("TODO: RUSTPYTHON, infinite recursion") def test_length_zero_header(self): # bpo-39017 (CVE-2019-20907): reading a zero-length header should fail # with an exception diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index d389529ca3..5e5c77e34c 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,7 +1735,7 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.skip('TODO: RUSTPYTHON; No such file or directory "..."') + @unittest.expectedFailure # TODO: RUSTPYTHON def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index f55cf3656e..4ae8a833b9 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -105,7 +105,6 @@ def test_nt_and_posix_stack_size(self): thread.stack_size(0) - @unittest.skip("TODO: RUSTPYTHON, weakref destructors") def test__count(self): # Test the _count() function. orig = thread._count() diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 910797afa8..6d3e34a0b6 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -319,7 +319,7 @@ def f(mutex): # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) # exposed at the Python level. This test relies on ctypes to get at it. - @unittest.skip('TODO: RUSTPYTHON; expects @cpython_only') + @unittest.expectedFailure # TODO: RUSTPYTHON; expects @cpython_only def test_PyThreadState_SetAsyncExc(self): ctypes = import_module("ctypes") @@ -424,7 +424,7 @@ def fail_new_thread(*args, **kwargs): finally: threading._start_joinable_thread = _start_joinable_thread - @unittest.skip('TODO: RUSTPYTHON; ctypes.pythonapi is not supported') + @unittest.expectedFailure # TODO: RUSTPYTHON; ctypes.pythonapi is not supported def test_finalize_running_thread(self): # Issue 1402: the PyGILState_Ensure / _Release functions may be called # very late on python exit: on deallocation of a running thread for diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 31a2a920d9..df3a72e302 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -622,7 +622,6 @@ def test_large_year(self): self.assertEqual(self.yearstr(12345), '12345') self.assertEqual(self.yearstr(123456789), '123456789') -@unittest.skip("TODO: RUSTPYTHON, ValueError: invalid struct_time parameter") class _TestStrftimeYear: # Issue 13305: For years < 1000, the value is not always diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index f40c7ee48b..70a0175d77 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -71,7 +71,6 @@ def testTypeCheck(self): self.assertRaises(TypeError, self.sock.settimeout, {}) self.assertRaises(TypeError, self.sock.settimeout, 0j) - @unittest.skip("TODO: RUSTPYTHON; crash") def testRangeCheck(self): # Test range checking by settimeout() self.assertRaises(ValueError, self.sock.settimeout, -1) diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index c118987411..e51a9f1a47 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -2066,7 +2066,7 @@ def test_threaded_weak_key_dict_deepcopy(self): # copying should not result in a crash. self.check_threaded_weak_dict_copy(weakref.WeakKeyDictionary, True) - @unittest.skip('TODO: RUSTPYTHON; occasionally crash (Exit code -6)') + @unittest.skip('TODO: RUSTPYTHON; flaky; occasionally crash (Exit code -6)') @threading_helper.requires_working_threading() def test_threaded_weak_value_dict_copy(self): # Issue #35615: Weakref keys or values getting GC'ed during dict diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index 63413d7b94..3ed856f741 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -3434,7 +3434,6 @@ def test_execute_zip64(self): self.assertIn(b'number in executable: 5', output) -@unittest.skip("TODO: RUSTPYTHON shift_jis encoding unsupported") class EncodedMetadataTests(unittest.TestCase): file_names = ['\u4e00', '\u4e8c', '\u4e09'] # Han 'one', 'two', 'three' file_content = [ @@ -3484,13 +3483,13 @@ def _test_read(self, zipfp, expected_names, expected_content): self.assertEqual(info.file_size, len(content)) self.assertEqual(zipfp.read(name), content) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_read_with_metadata_encoding(self): # Read the ZIP archive with correct metadata_encoding with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp: self._test_read(zipfp, self.file_names, self.file_content) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_read_without_metadata_encoding(self): # Read the ZIP archive without metadata_encoding expected_names = [name.encode('shift_jis').decode('cp437') @@ -3498,7 +3497,7 @@ def test_read_without_metadata_encoding(self): with zipfile.ZipFile(TESTFN, "r") as zipfp: self._test_read(zipfp, expected_names, self.file_content) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_read_with_incorrect_metadata_encoding(self): # Read the ZIP archive with incorrect metadata_encoding expected_names = [name.encode('shift_jis').decode('koi8-u') @@ -3506,7 +3505,7 @@ def test_read_with_incorrect_metadata_encoding(self): with zipfile.ZipFile(TESTFN, "r", metadata_encoding='koi8-u') as zipfp: self._test_read(zipfp, expected_names, self.file_content) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_read_with_unsuitable_metadata_encoding(self): # Read the ZIP archive with metadata_encoding unsuitable for # decoding metadata @@ -3515,7 +3514,7 @@ def test_read_with_unsuitable_metadata_encoding(self): with self.assertRaises(UnicodeDecodeError): zipfile.ZipFile(TESTFN, "r", metadata_encoding='utf-8') - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_read_after_append(self): newname = '\u56db' # Han 'four' expected_names = [name.encode('shift_jis').decode('cp437') @@ -3542,7 +3541,7 @@ def test_read_after_append(self): else: self.assertEqual(zipfp.read(name), content) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_write_with_metadata_encoding(self): ZF = zipfile.ZipFile for mode in ("w", "x", "a"): @@ -3550,7 +3549,7 @@ def test_write_with_metadata_encoding(self): "^metadata_encoding is only"): ZF("nonesuch.zip", mode, metadata_encoding="shift_jis") - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') def test_cli_with_metadata_encoding(self): errmsg = "Non-conforming encodings not supported with -c." args = ["--metadata-encoding=shift_jis", "-c", "nonesuch", "nonesuch"] @@ -3570,7 +3569,8 @@ def test_cli_with_metadata_encoding(self): for name in self.file_names: self.assertIn(name, listing) - @unittest.expectedFailure # TODO: RUSTPYTHON; + @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON def test_cli_with_metadata_encoding_extract(self): os.mkdir(TESTFN2) self.addCleanup(rmtree, TESTFN2) diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index a6898e9182..0282d35fb0 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -796,7 +796,7 @@ def testZip64CruftAndComment(self): files = self.getZip64Files() self.doTest(".py", files, "f65536", comment=b"c" * ((1 << 16) - 1)) - @unittest.skip('TODO: RUSTPYTHON; (intermittent success/failures); ValueError: name="RustPython/crates/pylib/Lib/test/zipimport_data/sparse-zip64-c0-0x000000000.part" does not fit expected pattern.') + @unittest.skip('TODO: RUSTPYTHON; flaky - ValueError: name="RustPython/crates/pylib/Lib/test/zipimport_data/sparse-zip64-c0-0x000000000.part" does not fit expected pattern.') def testZip64LargeFile(self): support.requires( "largefile", From 59b0be2344c2666a3b0df02d8a65d340265483e3 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 19:30:53 -0500 Subject: [PATCH 02/13] Fixed failing tests --- Lib/test/test_class.py | 1 + Lib/test/test_descr.py | 3 ++- Lib/test/test_ftplib.py | 11 +++++++++++ Lib/test/test_importlib/test_threaded_import.py | 1 + Lib/test/test_socket.py | 7 +++++++ Lib/test/test_sort.py | 1 + Lib/test/test_sqlite3/test_regression.py | 1 + Lib/test/test_ssl.py | 1 + Lib/test/test_subprocess.py | 2 +- Lib/test/test_tempfile.py | 2 +- 10 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 91d12a24c8..ed34d691bb 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -978,6 +978,7 @@ class Bar: pass self.assertIsInstance(f, Bar) self.assertEqual(f.__dict__, {}) + @unittest.skip("TODO: RUSTPYTHON, unexpectedly long runtime") def test_store_attr_type_cache(self): """Verifies that the type cache doesn't provide a value which is inconsistent from the dict.""" diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index daf5f0ce15..89878587fc 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1834,7 +1834,8 @@ def __init__(self, foo): object.__init__(A(3)) self.assertRaises(TypeError, object.__init__, A(3), 5) - @unittest.expectedFailure + # TODO: RUSTPYTHON; The `expectedFailure` here is from CPython, so this test actually fails. Not run on linux? + # @unittest.expectedFailure def test_restored_object_new(self): class A(object): def __new__(cls, *args, **kwargs): diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 7c63237710..18c40ae554 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -919,6 +919,17 @@ def setUp(self, encoding=DEFAULT_ENCODING): self.client.auth() self.client.prot_p() + @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + def test_encoding_param(self): + super().test_encoding_param() + + @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + def test_storbinary(self): + super().test_storbinary() + + @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + def test_storbinary_rest(self): + super().test_storbinary_rest() @skipUnless(ssl, "SSL not available") @requires_subprocess() diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index 462be6ba48..b68f736ec7 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -255,6 +255,7 @@ def test_concurrent_futures_circular_import(self): 'partial', 'cfimport.py') script_helper.assert_python_ok(fn) + @unittest.expectedFailureIfWindows # TODO: RUSTPYTHON; AttributeError: module '_winapi' has no attribute 'NMPWAIT_WAIT_FOREVER - Not run on linux? def test_multiprocessing_pool_circular_import(self): # Regression test for bpo-41567 fn = os.path.join(os.path.dirname(__file__), diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index fc93b57354..c6ba84e57f 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -6844,6 +6844,13 @@ class SendfileUsingSendfileTest(SendfileUsingSendTest): def meth_from_sock(self, sock): return getattr(sock, "_sendfile_use_sendfile") + @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux? + def testWithTimeout(self): + super().testWithTimeout() + + @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux? + def testCount(self): + super().testCount() @unittest.skipUnless(HAVE_SOCKET_ALG, 'AF_ALG required') class LinuxKernelCryptoAPI(unittest.TestCase): diff --git a/Lib/test/test_sort.py b/Lib/test/test_sort.py index 2a86ac8c06..56b8fffc6c 100644 --- a/Lib/test/test_sort.py +++ b/Lib/test/test_sort.py @@ -132,6 +132,7 @@ def bad_key(x): class TestBugs(unittest.TestCase): + @unittest.skip("TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length; Only run on linux?") def test_bug453523(self): # bug 453523 -- list.sort() crasher. # If this fails, the most likely outcome is a core dump. diff --git a/Lib/test/test_sqlite3/test_regression.py b/Lib/test/test_sqlite3/test_regression.py index 16b8f126f0..188e0153f0 100644 --- a/Lib/test/test_sqlite3/test_regression.py +++ b/Lib/test/test_sqlite3/test_regression.py @@ -497,6 +497,7 @@ def test_recursive_cursor_init(self): self.assertRaisesRegex(sqlite.ProgrammingError, self.msg, self.cur.fetchall) + @unittest.skip("TODO: RUSTPYTHON; Hangs; Not run on linux?") def test_recursive_cursor_close(self): conv = lambda x: self.cur.close() with patch.dict(sqlite.converters, {"CLOSE": conv}): diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 05d2570892..d46bf9e881 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,6 +4596,7 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) + @unittest.expectedFailure("TODO: RUSTPYTHON; Not run on linux?") def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index af4f92f3ae..e72b6e9a53 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2318,7 +2318,7 @@ def _test_extra_groups_impl(self, *, gid, group_list): extra_groups=[name_group]) # No skip necessary, this test won't make it to a setgroup() call. - @unittest.expectedFailure # TODO: RUSTPYTHON + @unittest.skip('TODO: RUSTPYTHON; Not run on linux?') def test_extra_groups_invalid_gid_t_values(self): with self.assertRaises(ValueError): subprocess.check_call(ZERO_RETURN_CMD, extra_groups=[-1]) diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 5e5c77e34c..d973869401 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,7 +1735,7 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.expectedFailure # TODO: RUSTPYTHON + @unittest.expectedFailureIf(sys.platform != "darwin", "TODO: RUSTPYTHON; Not run in linux? Passes on Mac") def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: From 6c3ee496a35dce78ae3673aabc54eb8f78eecb1f Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 20:32:34 -0500 Subject: [PATCH 03/13] Fixed test_ftplib + test_socket + test_ssl + test_threaded_import failures --- Lib/test/test_ftplib.py | 6 +++--- Lib/test/test_importlib/test_threaded_import.py | 2 +- Lib/test/test_socket.py | 4 ++-- Lib/test/test_ssl.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 18c40ae554..112436f569 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -919,15 +919,15 @@ def setUp(self, encoding=DEFAULT_ENCODING): self.client.auth() self.client.prot_p() - @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') def test_encoding_param(self): super().test_encoding_param() - @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') def test_storbinary(self): super().test_storbinary() - @unittest.expectedFailureIfWindows #TODO: RUSTPYTHON; Not run on linux? Okay on mac + @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') def test_storbinary_rest(self): super().test_storbinary_rest() diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index b68f736ec7..f30d616fa1 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -255,7 +255,7 @@ def test_concurrent_futures_circular_import(self): 'partial', 'cfimport.py') script_helper.assert_python_ok(fn) - @unittest.expectedFailureIfWindows # TODO: RUSTPYTHON; AttributeError: module '_winapi' has no attribute 'NMPWAIT_WAIT_FOREVER - Not run on linux? + @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON; AttributeError: module "_winapi" has no attribute "NMPWAIT_WAIT_FOREVER"') def test_multiprocessing_pool_circular_import(self): # Regression test for bpo-41567 fn = os.path.join(os.path.dirname(__file__), diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index c6ba84e57f..ff1b4315a8 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -6844,11 +6844,11 @@ class SendfileUsingSendfileTest(SendfileUsingSendTest): def meth_from_sock(self, sock): return getattr(sock, "_sendfile_use_sendfile") - @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux? + @unittest.skip("TODO: RUSTPYTHON; os.sendfile count parameter not handled correctly; flaky") def testWithTimeout(self): super().testWithTimeout() - @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux? + @unittest.skip("TODO: RUSTPYTHON; os.sendfile count parameter not handled correctly; flaky") def testCount(self): super().testCount() diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index d46bf9e881..1664d47000 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,7 +4596,7 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - @unittest.expectedFailure("TODO: RUSTPYTHON; Not run on linux?") + @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux?" def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those From 55665b72c9f7d04cb3ec9d1311d64aa50127a3fa Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 20:35:46 -0500 Subject: [PATCH 04/13] Removed comments about which tests are run in which environment --- Lib/test/test_descr.py | 2 +- Lib/test/test_sort.py | 2 +- Lib/test/test_sqlite3/test_regression.py | 2 +- Lib/test/test_ssl.py | 2 +- Lib/test/test_subprocess.py | 2 +- Lib/test/test_tempfile.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 89878587fc..6974116b50 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1834,7 +1834,7 @@ def __init__(self, foo): object.__init__(A(3)) self.assertRaises(TypeError, object.__init__, A(3), 5) - # TODO: RUSTPYTHON; The `expectedFailure` here is from CPython, so this test actually fails. Not run on linux? + # TODO: RUSTPYTHON; The `expectedFailure` here is from CPython, so this test actually fails # @unittest.expectedFailure def test_restored_object_new(self): class A(object): diff --git a/Lib/test/test_sort.py b/Lib/test/test_sort.py index 56b8fffc6c..37ce489b79 100644 --- a/Lib/test/test_sort.py +++ b/Lib/test/test_sort.py @@ -132,7 +132,7 @@ def bad_key(x): class TestBugs(unittest.TestCase): - @unittest.skip("TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length; Only run on linux?") + @unittest.skip("TODO: RUSTPYTHON; figure out how to detect sort mutation that doesn't change list length") def test_bug453523(self): # bug 453523 -- list.sort() crasher. # If this fails, the most likely outcome is a core dump. diff --git a/Lib/test/test_sqlite3/test_regression.py b/Lib/test/test_sqlite3/test_regression.py index 188e0153f0..016376b0f8 100644 --- a/Lib/test/test_sqlite3/test_regression.py +++ b/Lib/test/test_sqlite3/test_regression.py @@ -497,7 +497,7 @@ def test_recursive_cursor_init(self): self.assertRaisesRegex(sqlite.ProgrammingError, self.msg, self.cur.fetchall) - @unittest.skip("TODO: RUSTPYTHON; Hangs; Not run on linux?") + @unittest.skip("TODO: RUSTPYTHON; Hangs") def test_recursive_cursor_close(self): conv = lambda x: self.cur.close() with patch.dict(sqlite.converters, {"CLOSE": conv}): diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 1664d47000..3fbbe632fe 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,7 +4596,7 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - @unittest.expectedFailure #TODO: RUSTPYTHON; Not run on linux?" + @unittest.expectedFailure #TODO: RUSTPYTHON def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e72b6e9a53..1c73625876 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2318,7 +2318,7 @@ def _test_extra_groups_impl(self, *, gid, group_list): extra_groups=[name_group]) # No skip necessary, this test won't make it to a setgroup() call. - @unittest.skip('TODO: RUSTPYTHON; Not run on linux?') + @unittest.skip('TODO: RUSTPYTHON') def test_extra_groups_invalid_gid_t_values(self): with self.assertRaises(ValueError): subprocess.check_call(ZERO_RETURN_CMD, extra_groups=[-1]) diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index d973869401..852a64898a 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,7 +1735,7 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.expectedFailureIf(sys.platform != "darwin", "TODO: RUSTPYTHON; Not run in linux? Passes on Mac") + @unittest.expectedFailureIf(sys.platform != "darwin", "TODO: RUSTPYTHON") def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: From 4c1dd3829e07d283de758de085f78a24dd2a1185 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 20:49:35 -0500 Subject: [PATCH 05/13] Addressed PR comments --- Lib/test/test_sqlite3/test_dbapi.py | 2 -- Lib/test/test_threading.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 650069999d..a3ddd660cc 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -545,8 +545,6 @@ def test_connection_init_good_isolation_levels(self): cx.isolation_level = level self.assertEqual(cx.isolation_level, level) - # TODO: RUSTPYTHON - # @unittest.expectedFailure def test_connection_reinit(self): db = ":memory:" cx = sqlite.connect(db) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 6d3e34a0b6..e635a6f973 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -319,7 +319,7 @@ def f(mutex): # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) # exposed at the Python level. This test relies on ctypes to get at it. - @unittest.expectedFailure # TODO: RUSTPYTHON; expects @cpython_only + @cpython_only def test_PyThreadState_SetAsyncExc(self): ctypes = import_module("ctypes") From 87fa39d0f2d54ccfe35972d869e8e5227fff9961 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Mon, 12 Jan 2026 21:58:56 -0500 Subject: [PATCH 06/13] Annotated skips on failing tests --- Lib/test/test_ftplib.py | 15 ++------------- Lib/test/test_importlib/test_threaded_import.py | 3 ++- Lib/test/test_sqlite3/test_regression.py | 4 +++- Lib/test/test_ssl.py | 2 +- Lib/test/test_tempfile.py | 2 +- Lib/test/test_zipfile/test_core.py | 1 - 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 112436f569..6fe08bf0d1 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -8,6 +8,7 @@ import io import errno import os +import sys import threading import time import unittest @@ -902,7 +903,7 @@ def retr(): self.client.set_pasv(False) retr() - +@unittest.skip('TODO: RUSTPYTHON; SSL + asyncore has problem; flaky') @skipUnless(ssl, "SSL not available") @requires_subprocess() class TestTLS_FTPClassMixin(TestFTPClass): @@ -919,18 +920,6 @@ def setUp(self, encoding=DEFAULT_ENCODING): self.client.auth() self.client.prot_p() - @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') - def test_encoding_param(self): - super().test_encoding_param() - - @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') - def test_storbinary(self): - super().test_storbinary() - - @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON') - def test_storbinary_rest(self): - super().test_storbinary_rest() - @skipUnless(ssl, "SSL not available") @requires_subprocess() class TestTLS_FTPClass(TestCase): diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index f30d616fa1..f624e7d2c8 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -249,13 +249,14 @@ def target(): __import__(TESTFN) del sys.modules[TESTFN] + @unittest.skip('TODO: RUSTPYTHON; hang; Suspected cause of crashes in Windows CI - PermissionError: [WinError 32] Permission denied: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\test_python_0cdrhhs_\\test_python_6340æ"') def test_concurrent_futures_circular_import(self): # Regression test for bpo-43515 fn = os.path.join(os.path.dirname(__file__), 'partial', 'cfimport.py') script_helper.assert_python_ok(fn) - @unittest.expectedFailureIfWindows('TODO: RUSTPYTHON; AttributeError: module "_winapi" has no attribute "NMPWAIT_WAIT_FOREVER"') + @unittest.skip('TODO: RUSTPYTHON; hang') def test_multiprocessing_pool_circular_import(self): # Regression test for bpo-41567 fn = os.path.join(os.path.dirname(__file__), diff --git a/Lib/test/test_sqlite3/test_regression.py b/Lib/test/test_sqlite3/test_regression.py index 016376b0f8..bf8709810c 100644 --- a/Lib/test/test_sqlite3/test_regression.py +++ b/Lib/test/test_sqlite3/test_regression.py @@ -266,6 +266,7 @@ def collation_cb(a, b): # Lone surrogate cannot be encoded to the default encoding (utf8) "\uDC80", collation_cb) + @unittest.skip("TODO: RUSTPYTHON; deadlock") def test_recursive_cursor_use(self): """ http://bugs.python.org/issue10811 @@ -447,6 +448,7 @@ def test_table_lock_cursor_dealloc(self): con.execute("drop table t") con.commit() + @unittest.skip("TODO: RUSTPYTHON; deadlock") def test_table_lock_cursor_non_readonly_select(self): with memory_database() as con: con.execute("create table t(t)") @@ -474,6 +476,7 @@ def test_executescript_step_through_select(self): self.assertEqual(steps, values) +@unittest.skip('TODO: RUSTPYTHON deadlock') class RecursiveUseOfCursors(unittest.TestCase): # GH-80254: sqlite3 should not segfault for recursive use of cursors. msg = "Recursive use of cursors not allowed" @@ -497,7 +500,6 @@ def test_recursive_cursor_init(self): self.assertRaisesRegex(sqlite.ProgrammingError, self.msg, self.cur.fetchall) - @unittest.skip("TODO: RUSTPYTHON; Hangs") def test_recursive_cursor_close(self): conv = lambda x: self.cur.close() with patch.dict(sqlite.converters, {"CLOSE": conv}): diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 3fbbe632fe..d1865afddb 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,7 +4596,7 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - @unittest.expectedFailure #TODO: RUSTPYTHON + @unittest.skip('TODO: RUSTPYTHON') def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 852a64898a..a1e9211dc7 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,7 +1735,7 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.expectedFailureIf(sys.platform != "darwin", "TODO: RUSTPYTHON") + @unittest.skip('TODO: RUSTPYTHON; alters the execution environment (env changed)') def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index 3ed856f741..abad5920ba 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -3570,7 +3570,6 @@ def test_cli_with_metadata_encoding(self): self.assertIn(name, listing) @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') - @unittest.expectedFailure # TODO: RUSTPYTHON def test_cli_with_metadata_encoding_extract(self): os.mkdir(TESTFN2) self.addCleanup(rmtree, TESTFN2) From e0fa4267d287104f1bbca072781d6d9053401cc9 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 11:59:14 -0500 Subject: [PATCH 07/13] Removed unneeded tests --- Lib/test/test_io.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index ea77c7243c..741920a586 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1843,12 +1843,6 @@ def test_bad_readinto_type(self): def test_error_through_destructor(self): return super().test_error_through_destructor() - def test_truncate_on_read_only(self): - return super().test_truncate_on_read_only() - - def test_constructor(self): - return super().test_constructor() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_pickling_subclass(self): return super().test_pickling_subclass() @@ -2195,9 +2189,6 @@ def test_args_error(self): def test_error_through_destructor(self): return super().test_error_through_destructor() - def test_constructor(self): - return super().test_constructor() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_pickling_subclass(self): return super().test_pickling_subclass() @@ -2693,9 +2684,6 @@ def test_args_error(self): def test_error_through_destructor(self): return super().test_error_through_destructor() - def test_constructor(self): - return super().test_constructor() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_pickling_subclass(self): return super().test_pickling_subclass() @@ -4219,16 +4207,10 @@ def write(self, data): self.assertEqual([b"abcdef", b"middle", b"g"*chunk_size], buf._write_stack) - def test_basic_io(self): - return super().test_basic_io() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_constructor(self): return super().test_constructor() - def test_detach(self): - return super().test_detach() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_newlines(self): return super().test_newlines() @@ -4285,9 +4267,6 @@ def test_error_through_destructor(self): def test_repr(self): return super().test_repr() - def test_uninitialized(self): - return super().test_uninitialized() - @unittest.expectedFailure # TODO: RUSTPYTHON def test_recursive_repr(self): return super().test_recursive_repr() From 46677e75dccf5a0bb7157be809d852b18eaef8f8 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 12:05:06 -0500 Subject: [PATCH 08/13] Removed unneeded sys import from test_ftplib --- Lib/test/test_ftplib.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 6fe08bf0d1..1a8fa0fcc3 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -8,7 +8,6 @@ import io import errno import os -import sys import threading import time import unittest From 96daa90091ededecc33257df3133c54c5461260d Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 18:04:49 -0500 Subject: [PATCH 09/13] Added annotation to test_ftplib --- Lib/test/test_ftplib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 1a8fa0fcc3..c75a344a04 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -1006,6 +1006,7 @@ def test_context(self): self.assertIs(sock.context, ctx) self.assertIsInstance(sock, ssl.SSLSocket) + @unittest.skip('TODO: RUSTPYTHON; flaky') def test_ccc(self): self.assertRaises(ValueError, self.client.ccc) self.client.login(secure=True) From 4f86cbf661c2f4e8aa09cacfb3c0e3b04045a8f8 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 19:22:35 -0500 Subject: [PATCH 10/13] Readded skipIf to test_cleanup_with_symlink_modes with a more general ENV_POLLUTING_TESTS_WINDOWS --- .github/workflows/ci.yaml | 1 + Lib/test/test_tempfile.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b8263026d5..a52d0ba6cd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -114,6 +114,7 @@ env: test.test_multiprocessing_forkserver.test_processes test.test_multiprocessing_spawn.test_processes ENV_POLLUTING_TESTS_WINDOWS: >- + test.test_tempfile # Python version targeted by the CI. PYTHON_VERSION: "3.13.1" X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index a1e9211dc7..f81ab95771 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,7 +1735,10 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.skip('TODO: RUSTPYTHON; alters the execution environment (env changed)') + @unittest.skipIf( + sys.platform == 'win32' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + 'TODO: RUSTPYTHON; alters the execution environment (env changed)' + ) def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: From d5035f4a39e3fbe44641abe7eab5815d2d087b80 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 20:57:31 -0500 Subject: [PATCH 11/13] Addressed PR comments --- .github/workflows/ci.yaml | 1 - Lib/test/test_ast/test_ast.py | 4 ++-- Lib/test/test_bdb.py | 6 ++---- Lib/test/test_class.py | 2 +- Lib/test/test_cmd_line_script.py | 8 +++---- Lib/test/test_configparser.py | 1 + Lib/test/test_descr.py | 6 +++--- Lib/test/test_docxmlrpc.py | 2 +- Lib/test/test_ftplib.py | 2 +- Lib/test/test_importlib/test_locks.py | 2 +- Lib/test/test_json/test_recursion.py | 2 +- Lib/test/test_list.py | 8 +++---- Lib/test/test_marshal.py | 2 +- Lib/test/test_poll.py | 2 +- Lib/test/test_set.py | 16 ++------------ Lib/test/test_socket.py | 27 ++++++++++++++++-------- Lib/test/test_sqlite3/test_regression.py | 6 +++--- Lib/test/test_ssl.py | 2 +- Lib/test/test_subprocess.py | 2 +- Lib/test/test_tempfile.py | 5 +---- Lib/test/test_weakref.py | 2 +- Lib/test/test_zipfile/test_core.py | 17 ++++++++------- Lib/test/test_zipimport.py | 2 +- 23 files changed, 60 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a52d0ba6cd..b8263026d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -114,7 +114,6 @@ env: test.test_multiprocessing_forkserver.test_processes test.test_multiprocessing_spawn.test_processes ENV_POLLUTING_TESTS_WINDOWS: >- - test.test_tempfile # Python version targeted by the CI. PYTHON_VERSION: "3.13.1" X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py index 1ad05fe41e..57c19477ab 100644 --- a/Lib/test/test_ast/test_ast.py +++ b/Lib/test/test_ast/test_ast.py @@ -2183,7 +2183,7 @@ def test_yield(self): self.expr(ast.Yield(ast.Name("x", ast.Store())), "must have Load") self.expr(ast.YieldFrom(ast.Name("x", ast.Store())), "must have Load") - @unittest.skip('TODO: RUSTPYTHON; thread "main" panicked') + @unittest.skip("TODO: RUSTPYTHON; thread 'main' panicked") def test_compare(self): left = ast.Name("x", ast.Load()) comp = ast.Compare(left, [ast.In()], []) @@ -2396,7 +2396,7 @@ def test_stdlib_validates(self): ast.MatchMapping([], [], rest="_"), ] - @unittest.expectedFailure # TODO: RUSTPYTHON; thread 'main' panicked + @unittest.expectedFailure # TODO: RUSTPYTHON def test_match_validation_pattern(self): name_x = ast.Name("x", ast.Load()) for pattern in self._MATCH_PATTERNS: diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index f9ba938307..c41fb763a1 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -616,8 +616,7 @@ def test_step_next_on_last_statement(self): with TracerRun(self) as tracer: tracer.runcall(tfunc_main) - # AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',), ('quit',)] - @unittest.expectedFailure # TODO: RUSTPYTHON + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',), ('quit',)] def test_stepinstr(self): self.expect_set = [ ('line', 2, 'tfunc_main'), ('stepinstr', ), @@ -1249,8 +1248,7 @@ def main(): with TracerRun(self) as tracer: tracer.runcall(tfunc_import) - # AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',)] - @unittest.expectedFailure # TODO: RUSTPYTHON + @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: All paired tuples have not been processed, the last one was number 1 [('next',)] def test_next_to_botframe(self): # gh-125422 # Check that next command won't go to the bottom frame. diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index ed34d691bb..a70a807897 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -554,7 +554,7 @@ class Custom: self.assertFalse(hasattr(o, "__call__")) self.assertFalse(hasattr(c, "__call__")) - @unittest.skip('TODO: RUSTPYTHON; segmentation fault') + @unittest.skip("TODO: RUSTPYTHON, segmentation fault") def testSFBug532646(self): # Test for SF bug 532646 diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index f5973c7a9e..d2b3a7d3e4 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -209,19 +209,19 @@ def check_repl_stderr_flush(self, separate_stderr=False): self.assertIn(b'File ""', stderr.readline()) self.assertIn(b'ZeroDivisionError', stderr.readline()) - @unittest.skip('TODO: RUSTPYTHON; hanging') + @unittest.skip("TODO: RUSTPYTHON, test hang in middle") def test_repl_stdout_flush(self): self.check_repl_stdout_flush() - @unittest.skip('TODO: RUSTPYTHON; hanging') + @unittest.skip("TODO: RUSTPYTHON, test hang in middle") def test_repl_stdout_flush_separate_stderr(self): self.check_repl_stdout_flush(True) - @unittest.skip('TODO: RUSTPYTHON; hanging') + @unittest.skip("TODO: RUSTPYTHON, test hang in middle") def test_repl_stderr_flush(self): self.check_repl_stderr_flush() - @unittest.skip('TODO: RUSTPYTHON; hanging') + @unittest.skip("TODO: RUSTPYTHON, test hang in middle") def test_repl_stderr_flush_separate_stderr(self): self.check_repl_stderr_flush(True) diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index 3e2b1a8da3..d95b504f82 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -762,6 +762,7 @@ def test_read_returns_file_list(self): parsed_files = cf.read([], encoding="utf-8") self.assertEqual(parsed_files, []) + # XXX: RUSTPYTHON; This test might cause CI hang def test_read_returns_file_list_with_bytestring_path(self): if self.delimiters[0] != '=': self.skipTest('incompatible format') diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 6974116b50..7420a49b8f 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1834,7 +1834,7 @@ def __init__(self, foo): object.__init__(A(3)) self.assertRaises(TypeError, object.__init__, A(3), 5) - # TODO: RUSTPYTHON; The `expectedFailure` here is from CPython, so this test actually fails + # TODO: RUSTPYTHON; The `expectedFailure` here is from CPython, so this test must fail # @unittest.expectedFailure def test_restored_object_new(self): class A(object): @@ -5193,7 +5193,7 @@ def __pow__(self, *args): class MiscTests(unittest.TestCase): - @unittest.skip('TODO: RUSTPYTHON; rustpython panicked at "dict has non-string keys: [PyObject PyBaseObject]"') + @unittest.skip("TODO: RUSTPYTHON; rustpython panicked at 'dict has non-string keys: [PyObject PyBaseObject]'") def test_type_lookup_mro_reference(self): # Issue #14199: _PyType_Lookup() has to keep a strong reference to # the type MRO because it may be modified during the lookup, if @@ -5640,7 +5640,7 @@ def __repr__(self): objcopy2 = deepcopy(objcopy) self._assert_is_copy(obj, objcopy2) - @unittest.skip('TODO: RUSTPYTHON; hanging') + @unittest.skip('TODO: RUSTPYTHON') def test_issue24097(self): # Slot name is freed inside __getattr__ and is later used. class S(str): # Not interned diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index d24b795e2c..999533a72a 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -214,7 +214,7 @@ def test_annotations(self): b'method_annotation(x: bytes)'), response.read()) - @unittest.expectedFailure # TODO: RUSTPYTHON; hTypeError: HTMLDoc.heading() missing 2 required positional arguments: "fgcol" and "bgcol" + @unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: HTMLDoc.heading() missing 2 required positional arguments: "fgcol" and "bgcol" def test_server_title_escape(self): # bpo-38243: Ensure that the server title and documentation # are escaped for HTML. diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index c75a344a04..922bf0ea84 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -921,6 +921,7 @@ def setUp(self, encoding=DEFAULT_ENCODING): @skipUnless(ssl, "SSL not available") @requires_subprocess() +@unittest.skip("TODO: RUSTPYTHON; SSL + asyncore has problem") class TestTLS_FTPClass(TestCase): """Specific TLS_FTP class tests.""" @@ -1006,7 +1007,6 @@ def test_context(self): self.assertIs(sock.context, ctx) self.assertIsInstance(sock, ssl.SSLSocket) - @unittest.skip('TODO: RUSTPYTHON; flaky') def test_ccc(self): self.assertRaises(ValueError, self.client.ccc) self.client.login(secure=True) diff --git a/Lib/test/test_importlib/test_locks.py b/Lib/test/test_importlib/test_locks.py index 122256e270..edf0329c75 100644 --- a/Lib/test/test_importlib/test_locks.py +++ b/Lib/test/test_importlib/test_locks.py @@ -99,7 +99,7 @@ def f(): self.assertEqual(len(results), NTHREADS) return results - @unittest.skip("TODO: RUSTPYTHON, flaky test") + @unittest.skip("TODO: RUSTPYTHON, sometimes hangs") def test_deadlock(self): results = self.run_deadlock_avoidance_test(True) # At least one of the threads detected a potential deadlock on its diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py index 4109250356..59f6f2c4b1 100644 --- a/Lib/test/test_json/test_recursion.py +++ b/Lib/test/test_json/test_recursion.py @@ -68,7 +68,7 @@ def default(self, o): self.fail("didn't raise ValueError on default recursion") # TODO: RUSTPYTHON - @unittest.skip('TODO: RUSTPYTHON; crashes') + @unittest.skip("TODO: RUSTPYTHON; crashes") def test_highly_nested_objects_decoding(self): # test that loading highly-nested objects doesn't segfault when C # accelerations are used. See #12017 diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py index d64b4851d3..ed061384f1 100644 --- a/Lib/test/test_list.py +++ b/Lib/test/test_list.py @@ -104,7 +104,7 @@ def test_empty_slice(self): x[:] = x self.assertEqual(x, []) - @unittest.skip('TODO: RUSTPYTHON; crash') + @unittest.skip("TODO: RUSTPYTHON; crash") def test_list_resize_overflow(self): # gh-97616: test new_allocated * sizeof(PyObject*) overflow # check in list_resize() @@ -118,7 +118,7 @@ def test_list_resize_overflow(self): with self.assertRaises((MemoryError, OverflowError)): lst *= size - @unittest.skip('TODO: RUSTPYTHON; hangs') + @unittest.skip("TODO: RUSTPYTHON; hangs") def test_repr_mutate(self): class Obj: @staticmethod @@ -227,7 +227,7 @@ class L(list): pass with self.assertRaises(TypeError): (3,) + L([1,2]) - @unittest.skip('TODO: RUSTPYTHON; hang') + @unittest.skip("TODO: RUSTPYTHON; hang") def test_equal_operator_modifying_operand(self): # test fix for seg fault reported in bpo-38588 part 2. class X: @@ -253,7 +253,7 @@ def __eq__(self, other): list4 = [1] self.assertFalse(list3 == list4) - @unittest.skip('TODO: RUSTPYTHON; hang') + @unittest.skip("TODO: RUSTPYTHON; hang") def test_lt_operator_modifying_operand(self): # See gh-120298 class evil: diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index 3b1a97f424..142b45f6a4 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -498,7 +498,7 @@ def testModule(self): self.helper(code) self.helper3(code) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.skip("TODO: RUSTPYTHON") def testRecursion(self): obj = 1.2345 d = {"hello": obj, "goodbye": obj, obj: "hello"} diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 65dea94326..a9bfb755c3 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -181,7 +181,7 @@ def test_poll_c_limits(self): self.assertRaises(OverflowError, pollster.poll, INT_MAX + 1) self.assertRaises(OverflowError, pollster.poll, UINT_MAX + 1) - @unittest.skip('TODO: RUSTPYTHON; fd reallocation') + @unittest.skip("TODO: RUSTPYTHON fd reallocation") @threading_helper.reap_threads def test_threaded_poll(self): r, w = os.pipe() diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 0807162681..8ef2871c61 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1809,29 +1809,24 @@ def check_set_op_does_not_crash(self, function): self.assertIn("changed size during iteration", str(e)) +@unittest.skip("TODO: RUSTPYTHON; segfault") class TestBinaryOpsMutating(TestOperationsMutating): - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_eq_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a == b) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ne_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a != b) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_lt_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a < b) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_le_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a <= b) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_gt_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a > b) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ge_with_mutation(self): self.check_set_op_does_not_crash(lambda a, b: a >= b) @@ -1852,19 +1847,16 @@ def f(a, b): a &= b self.check_set_op_does_not_crash(f) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ior_with_mutation(self): def f(a, b): a |= b self.check_set_op_does_not_crash(f) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_isub_with_mutation(self): def f(a, b): a -= b self.check_set_op_does_not_crash(f) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_ixor_with_mutation(self): def f(a, b): a ^= b @@ -1906,12 +1898,12 @@ class TestBinaryOpsMutating_Subclass_Set(TestBinaryOpsMutating, unittest.TestCas constructor2 = set +@unittest.skip("TODO: RUSTPYTHON; segfault") class TestMethodsMutating(TestOperationsMutating): def test_issubset_with_mutation(self): self.check_set_op_does_not_crash(set.issubset) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_issuperset_with_mutation(self): self.check_set_op_does_not_crash(set.issuperset) @@ -1927,22 +1919,18 @@ def test_difference_with_mutation(self): def test_symmetric_difference_with_mutation(self): self.check_set_op_does_not_crash(set.symmetric_difference) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_isdisjoint_with_mutation(self): self.check_set_op_does_not_crash(set.isdisjoint) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_difference_update_with_mutation(self): self.check_set_op_does_not_crash(set.difference_update) def test_intersection_update_with_mutation(self): self.check_set_op_does_not_crash(set.intersection_update) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_symmetric_difference_update_with_mutation(self): self.check_set_op_does_not_crash(set.symmetric_difference_update) - @unittest.skip('TODO: RUSTPYTHON; segfault') def test_update_with_mutation(self): self.check_set_op_does_not_crash(set.update) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index ff1b4315a8..57539a3862 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -905,7 +905,8 @@ def requireSocket(*args): class GeneralModuleTests(unittest.TestCase): @unittest.skipUnless(_socket is not None, 'need _socket module') - @unittest.expectedFailure # TODO: RUSTPYTHON; gc.is_tracked not implemented + # TODO: RUSTPYTHON; gc.is_tracked not implemented + @unittest.expectedFailure def test_socket_type(self): self.assertTrue(gc.is_tracked(_socket.socket)) with self.assertRaisesRegex(TypeError, "immutable"): @@ -968,7 +969,8 @@ def testSocketError(self): with self.assertRaises(OSError, msg=msg % 'socket.gaierror'): raise socket.gaierror - @unittest.expectedFailure # TODO: RUSTPYTHON; error message format differs + # TODO: RUSTPYTHON; error message format differs + @unittest.expectedFailure def testSendtoErrors(self): # Testing that sendto doesn't mask failures. See #10169. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) @@ -2392,7 +2394,8 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.interface = "vcan0" - @unittest.expectedFailure # TODO: RUSTPYTHON - J1939 constants not fully implemented + # TODO: RUSTPYTHON - J1939 constants not fully implemented + @unittest.expectedFailure @unittest.skipUnless(hasattr(socket, "CAN_J1939"), 'socket.CAN_J1939 required for this test.') def testJ1939Constants(self): @@ -2434,7 +2437,8 @@ def testCreateJ1939Socket(self): with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: pass - @unittest.expectedFailure # TODO: RUSTPYTHON - AF_CAN J1939 address format not fully implemented + # TODO: RUSTPYTHON - AF_CAN J1939 address format not fully implemented + @unittest.expectedFailure def testBind(self): try: with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: @@ -6485,7 +6489,8 @@ def remoteProcessServer(cls, q): s2.close() s.close() - @unittest.expectedFailure # TODO: RUSTPYTHON; multiprocessing.SemLock not implemented + # TODO: RUSTPYTHON; multiprocessing.SemLock not implemented + @unittest.expectedFailure def testShare(self): # Transfer the listening server socket to another process # and service it from there. @@ -6887,7 +6892,8 @@ def test_sha256(self): op.send(b'') self.assertEqual(op.recv(512), expected) - @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented + # TODO: RUSTPYTHON - AF_ALG not fully implemented + @unittest.expectedFailure def test_hmac_sha1(self): # gh-109396: In FIPS mode, Linux 6.5 requires a key # of at least 112 bits. Use a key of 152 bits. @@ -6903,7 +6909,8 @@ def test_hmac_sha1(self): # Although it should work with 3.19 and newer the test blocks on # Ubuntu 15.10 with Kernel 4.2.0-19. - @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented + # TODO: RUSTPYTHON - AF_ALG not fully implemented + @unittest.expectedFailure @support.requires_linux_version(4, 3) def test_aes_cbc(self): key = bytes.fromhex('06a9214036b8a15b512e03d534120006') @@ -6945,7 +6952,8 @@ def test_aes_cbc(self): self.assertEqual(len(dec), msglen * multiplier) self.assertEqual(dec, msg * multiplier) - @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented + # TODO: RUSTPYTHON - AF_ALG not fully implemented + @unittest.expectedFailure @support.requires_linux_version(4, 9) # see gh-73510 def test_aead_aes_gcm(self): kernel_version = support._get_kernel_version("Linux") @@ -7015,7 +7023,8 @@ def test_aead_aes_gcm(self): res = op.recv(len(msg) - taglen) self.assertEqual(plain, res[assoclen:]) - @unittest.expectedFailure # TODO: RUSTPYTHON - AF_ALG not fully implemented + # TODO: RUSTPYTHON - AF_ALG not fully implemented + @unittest.expectedFailure @support.requires_linux_version(4, 3) # see test_aes_cbc def test_drbg_pr_sha256(self): # deterministic random bit generator, prediction resistance, sha256 diff --git a/Lib/test/test_sqlite3/test_regression.py b/Lib/test/test_sqlite3/test_regression.py index bf8709810c..d746be647c 100644 --- a/Lib/test/test_sqlite3/test_regression.py +++ b/Lib/test/test_sqlite3/test_regression.py @@ -266,7 +266,7 @@ def collation_cb(a, b): # Lone surrogate cannot be encoded to the default encoding (utf8) "\uDC80", collation_cb) - @unittest.skip("TODO: RUSTPYTHON; deadlock") + @unittest.skip("TODO: RUSTPYTHON deadlock") def test_recursive_cursor_use(self): """ http://bugs.python.org/issue10811 @@ -448,7 +448,7 @@ def test_table_lock_cursor_dealloc(self): con.execute("drop table t") con.commit() - @unittest.skip("TODO: RUSTPYTHON; deadlock") + @unittest.skip("TODO: RUSTPYTHON deadlock") def test_table_lock_cursor_non_readonly_select(self): with memory_database() as con: con.execute("create table t(t)") @@ -476,7 +476,7 @@ def test_executescript_step_through_select(self): self.assertEqual(steps, values) -@unittest.skip('TODO: RUSTPYTHON deadlock') +@unittest.skip("TODO: RUSTPYTHON deadlock") class RecursiveUseOfCursors(unittest.TestCase): # GH-80254: sqlite3 should not segfault for recursive use of cursors. msg = "Recursive use of cursors not allowed" diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index d1865afddb..5384e4caf6 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4596,7 +4596,7 @@ def server_callback(identity): with client_context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - @unittest.skip('TODO: RUSTPYTHON') + @unittest.skip("TODO: rustpython") def test_thread_recv_while_main_thread_sends(self): # GH-137583: Locking was added to calls to send() and recv() on SSL # socket objects. This seemed fine at the surface level because those diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 1c73625876..4d05865272 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2318,7 +2318,7 @@ def _test_extra_groups_impl(self, *, gid, group_list): extra_groups=[name_group]) # No skip necessary, this test won't make it to a setgroup() call. - @unittest.skip('TODO: RUSTPYTHON') + @unittest.skip('TODO: RUSTPYTHON; clarify failure condition') def test_extra_groups_invalid_gid_t_values(self): with self.assertRaises(ValueError): subprocess.check_call(ZERO_RETURN_CMD, extra_groups=[-1]) diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index f81ab95771..d389529ca3 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1735,10 +1735,7 @@ def test_cleanup_with_symlink_to_a_directory(self): d2.cleanup() @os_helper.skip_unless_symlink - @unittest.skipIf( - sys.platform == 'win32' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, - 'TODO: RUSTPYTHON; alters the execution environment (env changed)' - ) + @unittest.skip('TODO: RUSTPYTHON; No such file or directory "..."') def test_cleanup_with_symlink_modes(self): # cleanup() should not follow symlinks when fixing mode bits (#91133) with self.do_create(recurse=0) as d2: diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index e51a9f1a47..c118987411 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -2066,7 +2066,7 @@ def test_threaded_weak_key_dict_deepcopy(self): # copying should not result in a crash. self.check_threaded_weak_dict_copy(weakref.WeakKeyDictionary, True) - @unittest.skip('TODO: RUSTPYTHON; flaky; occasionally crash (Exit code -6)') + @unittest.skip('TODO: RUSTPYTHON; occasionally crash (Exit code -6)') @threading_helper.requires_working_threading() def test_threaded_weak_value_dict_copy(self): # Issue #35615: Weakref keys or values getting GC'ed during dict diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index abad5920ba..63413d7b94 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -3434,6 +3434,7 @@ def test_execute_zip64(self): self.assertIn(b'number in executable: 5', output) +@unittest.skip("TODO: RUSTPYTHON shift_jis encoding unsupported") class EncodedMetadataTests(unittest.TestCase): file_names = ['\u4e00', '\u4e8c', '\u4e09'] # Han 'one', 'two', 'three' file_content = [ @@ -3483,13 +3484,13 @@ def _test_read(self, zipfp, expected_names, expected_content): self.assertEqual(info.file_size, len(content)) self.assertEqual(zipfp.read(name), content) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_read_with_metadata_encoding(self): # Read the ZIP archive with correct metadata_encoding with zipfile.ZipFile(TESTFN, "r", metadata_encoding='shift_jis') as zipfp: self._test_read(zipfp, self.file_names, self.file_content) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_read_without_metadata_encoding(self): # Read the ZIP archive without metadata_encoding expected_names = [name.encode('shift_jis').decode('cp437') @@ -3497,7 +3498,7 @@ def test_read_without_metadata_encoding(self): with zipfile.ZipFile(TESTFN, "r") as zipfp: self._test_read(zipfp, expected_names, self.file_content) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_read_with_incorrect_metadata_encoding(self): # Read the ZIP archive with incorrect metadata_encoding expected_names = [name.encode('shift_jis').decode('koi8-u') @@ -3505,7 +3506,7 @@ def test_read_with_incorrect_metadata_encoding(self): with zipfile.ZipFile(TESTFN, "r", metadata_encoding='koi8-u') as zipfp: self._test_read(zipfp, expected_names, self.file_content) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_read_with_unsuitable_metadata_encoding(self): # Read the ZIP archive with metadata_encoding unsuitable for # decoding metadata @@ -3514,7 +3515,7 @@ def test_read_with_unsuitable_metadata_encoding(self): with self.assertRaises(UnicodeDecodeError): zipfile.ZipFile(TESTFN, "r", metadata_encoding='utf-8') - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_read_after_append(self): newname = '\u56db' # Han 'four' expected_names = [name.encode('shift_jis').decode('cp437') @@ -3541,7 +3542,7 @@ def test_read_after_append(self): else: self.assertEqual(zipfp.read(name), content) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_write_with_metadata_encoding(self): ZF = zipfile.ZipFile for mode in ("w", "x", "a"): @@ -3549,7 +3550,7 @@ def test_write_with_metadata_encoding(self): "^metadata_encoding is only"): ZF("nonesuch.zip", mode, metadata_encoding="shift_jis") - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_cli_with_metadata_encoding(self): errmsg = "Non-conforming encodings not supported with -c." args = ["--metadata-encoding=shift_jis", "-c", "nonesuch", "nonesuch"] @@ -3569,7 +3570,7 @@ def test_cli_with_metadata_encoding(self): for name in self.file_names: self.assertIn(name, listing) - @unittest.skip('TODO: RUSTPYTHON; shift_jis encoding unsupported') + @unittest.expectedFailure # TODO: RUSTPYTHON; def test_cli_with_metadata_encoding_extract(self): os.mkdir(TESTFN2) self.addCleanup(rmtree, TESTFN2) diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 0282d35fb0..a6898e9182 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -796,7 +796,7 @@ def testZip64CruftAndComment(self): files = self.getZip64Files() self.doTest(".py", files, "f65536", comment=b"c" * ((1 << 16) - 1)) - @unittest.skip('TODO: RUSTPYTHON; flaky - ValueError: name="RustPython/crates/pylib/Lib/test/zipimport_data/sparse-zip64-c0-0x000000000.part" does not fit expected pattern.') + @unittest.skip('TODO: RUSTPYTHON; (intermittent success/failures); ValueError: name="RustPython/crates/pylib/Lib/test/zipimport_data/sparse-zip64-c0-0x000000000.part" does not fit expected pattern.') def testZip64LargeFile(self): support.requires( "largefile", From 6a3932d081e1922f33bd980f881a3158aea95f44 Mon Sep 17 00:00:00 2001 From: Terry Luan Date: Tue, 13 Jan 2026 22:16:31 -0500 Subject: [PATCH 12/13] Made changes to minimize diff in PR --- Lib/test/test_ftplib.py | 3 ++- Lib/test/test_json/test_decode.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 922bf0ea84..5cb6a4e79a 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -919,9 +919,10 @@ def setUp(self, encoding=DEFAULT_ENCODING): self.client.auth() self.client.prot_p() + @skipUnless(ssl, "SSL not available") -@requires_subprocess() @unittest.skip("TODO: RUSTPYTHON; SSL + asyncore has problem") +@requires_subprocess() class TestTLS_FTPClass(TestCase): """Specific TLS_FTP class tests.""" diff --git a/Lib/test/test_json/test_decode.py b/Lib/test/test_json/test_decode.py index 387fee8436..f07f7d5533 100644 --- a/Lib/test/test_json/test_decode.py +++ b/Lib/test/test_json/test_decode.py @@ -19,7 +19,7 @@ def test_float(self): self.assertEqual(rval, 1.0) # TODO: RUSTPYTHON - @unittest.skip('TODO: RUSTPYTHON; called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }') + @unittest.skip("TODO: RUSTPYTHON; called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }") def test_nonascii_digits_rejected(self): # JSON specifies only ascii digits, see gh-125687 for num in ["1\uff10", "0.\uff10", "0e\uff10"]: From 6b57027050b87e61d572e2381a8089c7030e28c6 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" <69878+youknowone@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:29:52 +0900 Subject: [PATCH 13/13] Apply suggestion from @youknowone --- Lib/test/test_ftplib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 5cb6a4e79a..684f5d438b 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -902,7 +902,8 @@ def retr(): self.client.set_pasv(False) retr() -@unittest.skip('TODO: RUSTPYTHON; SSL + asyncore has problem; flaky') + +@unittest.skip("TODO: RUSTPYTHON; SSL + asyncore has problem") @skipUnless(ssl, "SSL not available") @requires_subprocess() class TestTLS_FTPClassMixin(TestFTPClass):