From 1827af100b61529ff7cd427255bd123d1c9c7f91 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Sat, 3 Jan 2026 14:34:38 -0500 Subject: [PATCH] Skip tests that pollute the environment for some reason --- .github/workflows/ci.yaml | 82 +++++++++++++++++++ Lib/test/test_file_eintr.py | 4 + .../test_importlib/resources/test_resource.py | 5 ++ .../test_processes.py | 52 ++++++++++++ .../test_multiprocessing_fork/test_threads.py | 12 +++ .../test_processes.py | 30 +++++++ .../test_threads.py | 8 ++ .../test_processes.py | 30 +++++++ .../test_threads.py | 8 ++ Lib/test/test_raise.py | 5 ++ Lib/test/test_ssl.py | 4 + Lib/test/test_subprocess.py | 4 + Lib/test/test_sys.py | 5 ++ 13 files changed, 249 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ec73ea02..23164ff9f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -105,6 +105,33 @@ env: test_unpack test_weakref test_yield_from + ENV_POLLUTING_TESTS_COMMON: >- + test_raise + test_ssl + test_sys + ENV_POLLUTING_TESTS_LINUX: >- + test.test_multiprocessing_fork.test_processes + test.test_multiprocessing_fork.test_threads + test.test_multiprocessing_forkserver.test_processes + test.test_multiprocessing_forkserver.test_threads + test.test_multiprocessing_spawn.test_processes + test.test_multiprocessing_spawn.test_threads + test_file_eintr + test_subprocess + ENV_POLLUTING_TESTS_MACOS: >- + test_multiprocessing_forkserver.test_manager + test.test_multiprocessing_forkserver.test_misc + test.test_multiprocessing_forkserver.test_processes + test.test_multiprocessing_forkserver.test_threads + test.test_multiprocessing_spawn.test_manager + test.test_multiprocessing_spawn.test_misc + test.test_multiprocessing_spawn.test_processes + test.test_multiprocessing_spawn.test_threads + test_ftplib + test_logging + test_multiprocessing_main_handling + test_subprocess + ENV_POLLUTING_TESTS_WINDOWS: >- # 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 @@ -278,26 +305,81 @@ jobs: - if: runner.os == 'Linux' name: run cpython platform-independent tests + env: + RUSTPYTHON_SKIP_ENV_POLLUTERS: true run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }} timeout-minutes: 35 - if: runner.os == 'Linux' name: run cpython platform-dependent tests (Linux) + env: + RUSTPYTHON_SKIP_ENV_POLLUTERS: true run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} timeout-minutes: 35 - if: runner.os == 'macOS' name: run cpython platform-dependent tests (MacOS) + env: + RUSTPYTHON_SKIP_ENV_POLLUTERS: true run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} timeout-minutes: 35 - if: runner.os == 'Windows' name: run cpython platform-dependent tests (windows partial - fixme) + env: + RUSTPYTHON_SKIP_ENV_POLLUTERS: true run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }} timeout-minutes: 45 + - if: runner.os == 'Linux' + name: run cpython tests to check if env polluters have stopped polluting (Common/Linux) + shell: bash + run: | + for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -ne 3 ]; then + echo "Test ${thing} is no longer polluting the environment!" + exit 1 + fi + done + timeout-minutes: 15 + + - if: runner.os == 'macOS' + name: run cpython tests to check if env polluters have stopped polluting (Common/macOS) + run: | + for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -ne 3 ]; then + echo "Test ${thing} is no longer polluting the environment!" + exit 1 + fi + done + timeout-minutes: 15 + + - if: runner.os == 'Windows' + name: run cpython tests to check if env polluters have stopped polluting (Common/windows) + shell: bash + run: | + for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -ne 3 ]; then + echo "Test ${thing} is no longer polluting the environment!" + exit 1 + fi + done + timeout-minutes: 15 + - if: runner.os != 'Windows' name: check that --install-pip succeeds run: | diff --git a/Lib/test/test_file_eintr.py b/Lib/test/test_file_eintr.py index fa9c6637f..f7d859028 100644 --- a/Lib/test/test_file_eintr.py +++ b/Lib/test/test_file_eintr.py @@ -186,6 +186,10 @@ class TestFileIOSignalInterrupt: class CTestFileIOSignalInterrupt(TestFileIOSignalInterrupt, unittest.TestCase): modname = '_io' + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason" + ) # TODO: RUSTPYTHON - _io.FileIO.readall uses read_to_end which differs from _pyio.FileIO.readall @unittest.expectedFailure def test_readall(self): diff --git a/Lib/test/test_importlib/resources/test_resource.py b/Lib/test/test_importlib/resources/test_resource.py index 6f75cf57f..54d32d9b2 100644 --- a/Lib/test/test_importlib/resources/test_resource.py +++ b/Lib/test/test_importlib/resources/test_resource.py @@ -192,6 +192,11 @@ class DeletingZipsTest(unittest.TestCase): def test_as_file_does_not_keep_open(self): # pragma: no cover resources.as_file(resources.files('ziptestdata') / 'binary.file') + import os # TODO: RUSTPYTHON see below + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to tmpfile leak" + ) def test_entered_path_does_not_keep_open(self): """ Mimic what certifi does on import to make its bundle diff --git a/Lib/test/test_multiprocessing_fork/test_processes.py b/Lib/test/test_multiprocessing_fork/test_processes.py index e64e9afc0..8c7e6b568 100644 --- a/Lib/test/test_multiprocessing_fork/test_processes.py +++ b/Lib/test/test_multiprocessing_fork/test_processes.py @@ -3,5 +3,57 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'fork', only_type="processes") +import os, sys # TODO: RUSTPYTHON +class WithProcessesTestCondition(WithProcessesTestCondition): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_notify_all(self): super().test_notify_all() # TODO: RUSTPYTHON + +class WithProcessesTestLock(WithProcessesTestLock): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError') + def test_repr_lock(self): super().test_repr_lock() # TODO: RUSTPYTHON + +class WithProcessesTestManagerRestart(WithProcessesTestManagerRestart): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError') + def test_rapid_restart(self): super().test_rapid_restart() # TODO: RUSTPYTHON + +class WithProcessesTestProcess(WithProcessesTestProcess): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_args_argument(self): super().test_args_argument() # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_process(self): super().test_process() # TODO: RUSTPYTHON + +class WithProcessesTestPool(WithProcessesTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_async_timeout(self): super().test_async_timeout() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_traceback(self): super().test_traceback() # TODO: RUSTPYTHON + +class WithProcessesTestPoolWorkerLifetime(WithProcessesTestPoolWorkerLifetime): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_pool_worker_lifetime(self): super().test_pool_worker_lifetime() # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_pool_worker_lifetime_early_close(self): super().test_pool_worker_lifetime_early_close() # TODO: RUSTPYTHON + +class WithProcessesTestQueue(WithProcessesTestQueue): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_fork(self): super().test_fork() # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky timeout') + def test_get(self): super().test_get() # TODO: RUSTPYTHON + +class WithProcessesTestSharedMemory(WithProcessesTestSharedMemory): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError') + def test_shared_memory_SharedMemoryManager_basics(self): super().test_shared_memory_SharedMemoryManager_basics() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_multiprocessing_fork/test_threads.py b/Lib/test/test_multiprocessing_fork/test_threads.py index 1670e34cb..b7b519bcb 100644 --- a/Lib/test/test_multiprocessing_fork/test_threads.py +++ b/Lib/test/test_multiprocessing_fork/test_threads.py @@ -3,5 +3,17 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'fork', only_type="threads") +import os, sys # TODO: RUSTPYTHON +class WithThreadsTestPool(WithThreadsTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + +class WithThreadsTestManagerRestart(WithThreadsTestManagerRestart): # TODO: RUSTPYTHON + @unittest.skipIf(sys.platform == 'linux', 'TODO: RUSTPYTHON flaky flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError') + def test_rapid_restart(self): super().test_rapid_restart() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_multiprocessing_forkserver/test_processes.py b/Lib/test/test_multiprocessing_forkserver/test_processes.py index 360967cf1..5c159f10d 100644 --- a/Lib/test/test_multiprocessing_forkserver/test_processes.py +++ b/Lib/test/test_multiprocessing_forkserver/test_processes.py @@ -3,5 +3,35 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'forkserver', only_type="processes") +import os, sys # TODO: RUSTPYTHON +class WithProcessesTestLock(WithProcessesTestLock): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_repr_lock(self): super().test_repr_lock() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux', # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError' + ) # TODO: RUSTPYTHON + def test_repr_rlock(self): super().test_repr_rlock() # TODO: RUSTPYTHON + +class WithProcessesTestPool(WithProcessesTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_async_timeout(self): super().test_async_timeout() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_traceback(self): super().test_traceback() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_multiprocessing_forkserver/test_threads.py b/Lib/test/test_multiprocessing_forkserver/test_threads.py index 719c752aa..1524e7bac 100644 --- a/Lib/test/test_multiprocessing_forkserver/test_threads.py +++ b/Lib/test/test_multiprocessing_forkserver/test_threads.py @@ -3,5 +3,13 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'forkserver', only_type="threads") +import os, sys # TODO: RUSTPYTHON +class WithThreadsTestPool(WithThreadsTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_multiprocessing_spawn/test_processes.py b/Lib/test/test_multiprocessing_spawn/test_processes.py index af764b0d8..2d4655807 100644 --- a/Lib/test/test_multiprocessing_spawn/test_processes.py +++ b/Lib/test/test_multiprocessing_spawn/test_processes.py @@ -3,5 +3,35 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'spawn', only_type="processes") +import os, sys # TODO: RUSTPYTHON +class WithProcessesTestLock(WithProcessesTestLock): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_repr_lock(self): super().test_repr_lock() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux', # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON flaky BrokenPipeError, flaky ConnectionRefusedError, flaky ConnectionResetError, flaky EOFError' + ) # TODO: RUSTPYTHON + def test_repr_rlock(self): super().test_repr_rlock() # TODO: RUSTPYTHON + +class WithProcessesTestPool(WithProcessesTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_async_timeout(self): super().test_async_timeout() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_traceback(self): super().test_traceback() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_multiprocessing_spawn/test_threads.py b/Lib/test/test_multiprocessing_spawn/test_threads.py index c1257749b..136e55ad2 100644 --- a/Lib/test/test_multiprocessing_spawn/test_threads.py +++ b/Lib/test/test_multiprocessing_spawn/test_threads.py @@ -3,5 +3,13 @@ from test._test_multiprocessing import install_tests_in_module_dict install_tests_in_module_dict(globals(), 'spawn', only_type="threads") +import os, sys # TODO: RUSTPYTHON +class WithThreadsTestPool(WithThreadsTestPool): # TODO: RUSTPYTHON + @unittest.skipIf( # TODO: RUSTPYTHON + sys.platform == 'linux' and 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, # TODO: RUSTPYTHON + 'TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason' + ) # TODO: RUSTPYTHON + def test_terminate(self): super().test_terminate() # TODO: RUSTPYTHON + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py index 605169f4b..8a2937ed3 100644 --- a/Lib/test/test_raise.py +++ b/Lib/test/test_raise.py @@ -464,6 +464,11 @@ class TestContext(unittest.TestCase): f() + import os # TODO: RUSTPYTHON see below + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unraisable exception" + ) def test_3611(self): import gc # A re-raised exception in a __del__ caused the __context__ diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 7450cd341..42de79349 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4299,6 +4299,10 @@ class ThreadedTests(unittest.TestCase): sni_name='supermessage') self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED') + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unraisable exception" + ) @unittest.expectedFailure # TODO: RUSTPYTHON def test_sni_callback_raising(self): # Raising fails the connection with a TLS handshake failure alert. diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 4d0586527..ce55eb596 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1292,6 +1292,10 @@ class ProcessTestCase(BaseTestCase): self.assertTrue(stderr.startswith("eline2\neline6\neline7\n")) @unittest.expectedFailure # TODO: RUSTPYTHON + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason" + ) def test_universal_newlines_communicate_encodings(self): # Check that universal newlines mode works for various encodings, # in particular for encodings in the UTF-16 and UTF-32 families. diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 969c2866a..fa4f9731c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -595,6 +595,11 @@ class SysModuleTest(unittest.TestCase): leave_g.set() t.join() + import os # TODO: RUSTPYTHON see below + @unittest.skipIf( + 'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ, + "TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to dangling threads" + ) @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'sys' has no attribute '_current_exceptions' @threading_helper.reap_threads @threading_helper.requires_working_threading()