Skip to content

Commit 2da05cd

Browse files
committed
Add comments
1 parent 59eb2ba commit 2da05cd

1 file changed

Lines changed: 41 additions & 15 deletions

File tree

‎Lib/test/libregrtest/skipped.py‎

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@
4747
EXPECTED_SKIP = set()
4848
if support.MS_WINDOWS:
4949
EXPECTED_SKIP |= {
50+
# UNIX only
5051
'test_asyncio.test_unix_events',
52+
# test_gdb doesn't work on Windows
5153
'test_gdb',
54+
# Can't test signal on Windows
5255
'test_threadsignals',
5356
}
5457
else:
5558
EXPECTED_SKIP |= {
59+
# Tests specific to Windows
5660
'test_asyncio.test_windows_events',
5761
'test_asyncio.test_windows_utils',
5862
'test_msvcrt',
@@ -89,7 +93,7 @@
8993
EXPECTED_SKIP.add('test_apple')
9094

9195
if not support.has_socket_support or IS_WASI:
92-
# need socket support
96+
# Need socket support
9397
EXPECTED_SKIP |= {
9498
'test_asyncgen',
9599
'test_asyncio',
@@ -114,7 +118,7 @@
114118
}
115119
EXPECTED_SKIP |= SELECT_TESTS
116120
if not support.has_subprocess_support or IS_WASI:
117-
# need subprocess support
121+
# Need subprocess support
118122
EXPECTED_SKIP |= {
119123
'test_argparse',
120124
'test_c_stack_unwind',
@@ -137,14 +141,19 @@
137141
}
138142
if support.is_emscripten:
139143
EXPECTED_SKIP |= {
144+
# Incompatible with Emscripten's mmap emulation
140145
'test_mmap',
146+
# Cannot create socketpair on Emscripten/WASI
141147
'test_selectors',
142148
}
143149
if support.is_android or support.is_apple_mobile or support.is_wasm32 or IS_WASI:
144150
EXPECTED_SKIP |= {
151+
# pty is not available on these platforms
145152
'test_pty',
153+
# venv is not available on these platforms
146154
'test_venv',
147155
}
156+
# On FreeBSD, is_remote_debug_enabled() is always false
148157
if not sys.is_remote_debug_enabled():
149158
EXPECTED_SKIP.add('test_remote_pdb')
150159
if not support.has_fork_support or IS_WASI:
@@ -156,44 +165,52 @@
156165
}
157166
if IS_WASI:
158167
EXPECTED_SKIP |= {
168+
# configure disables multiple extension modules on WASI
159169
'test__interpchannels', # need _interpchannels
160170
'test__interpreters', # need _interpreters
161-
'test_bz2', # need _bz2
162171
'test_crossinterp', # need _interpreters
163-
'test_ctypes', # need _ctypes
164172
'test_curses', # need _curses
165-
'test_dbm_sqlite3', # need _sqlite3
166173
'test_external_inspection', # need _remote_debugging
167174
'test_fcntl', # need fcntl
168175
'test_gc_stats', # need _remote_debugging
169176
'test_grp', # need grp
170-
'test_gzip', # need zlib
171177
'test_ioctl', # need fcntl
172-
'test_lzma', # need _lzma
173178
'test_mmap', # need mmap
174-
'test_openpty', # need os.openpty()
175179
'test_pwd', # need pwd
176180
'test_pyrepl', # need termios
177-
'test_remote_pdb', # need remote debugging
181+
'test_remote_pdb', # need _remote_debugging
178182
'test_resource', # need resource
179-
'test_sqlite3', # need _sqlite3
180-
'test_stable_abi_ctypes', # need _ctypes
181183
'test_syslog', # need syslog
182184
'test_termios', # need termios
183185
'test_tty', # need termios
184186
'test_xxlimited', # need xxlimited
187+
188+
# Missing functions on WASI
189+
'test_openpty', # need os.openpty()
190+
191+
# Missing dependencies on WASI
192+
'test_bz2', # need _bz2
193+
'test_ctypes', # need _ctypes
194+
'test_dbm_sqlite3', # need _sqlite3
195+
'test_gzip', # need zlib
196+
'test_lzma', # need _lzma
197+
'test_sqlite3', # need _sqlite3
198+
'test_stable_abi_ctypes', # need _ctypes
185199
'test_zlib', # need zlib
186200
'test_zstd', # need _zstd
187201
}
202+
# configure disables _multiprocessing and _testmultiphase
203+
# extension modules on WASI
204+
EXPECTED_SKIP |= NEED_TESTMULTIPHASE
188205
EXPECTED_SKIP |= NEED_MULTIPROCESSING
206+
# Missing OpenSSL dependency on WASI
189207
EXPECTED_SKIP |= NEED_SSL
190-
EXPECTED_SKIP |= NEED_TESTMULTIPHASE
191208

192209

193210
# Modules needed by a test.
194211
# Used to check if a test is expected to be skipped.
195-
# NEED_MODULES doesn't work on WASI, since the regrtest summary is run on the
196-
# build Python which is different than the host (WASI) Python.
212+
# NEED_MODULES doesn't work on WASI, since the main regrtest process is run
213+
# on the build Python which is different than the host (WASI) Python.
197214
NEED_MODULES = {
198215
'test__interpchannels': '_interpchannels',
199216
'test__interpreters': '_interpreters',
@@ -279,25 +296,34 @@ def expected_to_be_skipped(test_name):
279296
# Custom ruleset
280297
if (test_name in NEED_WORKING_THREADING
281298
or package in NEED_WORKING_THREADING):
299+
# Detect whether Python can start new threads
300+
# - wasm32-wasi does not have threading.
301+
# - wasm32-emscripten can be compiled with or without pthread
302+
# support (-s USE_PTHREADS / __EMSCRIPTEN_PTHREADS__).
282303
if IS_WASI:
283304
return True
284305
from test.support import threading_helper
285306
return not threading_helper.can_start_thread
286307

287308
if test_name in SELECT_TESTS:
309+
# For example, test_epoll needs select.epoll()
288310
import select
289311
name = test_name.removeprefix('test_')
290312
return not hasattr(select, name)
291313

292314
if test_name == 'test_dtrace':
315+
# Need ./configure --with-dtrace
293316
import sysconfig
294317
return not sysconfig.get_config_var('WITH_DTRACE')
295318

296319
if test_name in ('test_perf_profiler', 'test_perfmaps', 'test_samply_profiler'):
297-
# need perf trampoline profiling
320+
# Need perf trampoline profiling: configure defines the
321+
# PY_HAVE_PERF_TRAMPOLINE macro on Linux (x86-64 and AArch64)
322+
# and on macOS.
298323
return not support.supports_perf_trampoline_profiling()
299324

300325
if package == 'test_gdb':
326+
# Need gdb program
301327
import shutil
302328
return not shutil.which('gdb')
303329

0 commit comments

Comments
 (0)