Skip to content

Commit 17f9ca3

Browse files
committed
Filter more tests
1 parent 9f606c3 commit 17f9ca3

1 file changed

Lines changed: 42 additions & 10 deletions

File tree

‎Lib/test/libregrtest/skipped.py‎

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import importlib
77
import os
88
import sys
9+
import sysconfig
910
from test import support
1011

1112

@@ -51,6 +52,14 @@
5152
'test_threading_local',
5253
'test_webbrowser',
5354
}
55+
NEED_TKINTER = {
56+
'test_idle',
57+
'test_tcl',
58+
'test_tkinter',
59+
'test_ttk',
60+
'test_ttk_textonly',
61+
'test_turtle',
62+
}
5463

5564

5665
# List of tests expected to be skipped on sys.platform
@@ -92,6 +101,7 @@
92101
# Need subprocess support
93102
EXPECTED_SKIP |= {
94103
'test_argparse',
104+
'test_asyncio.test_subprocess',
95105
'test_c_stack_unwind',
96106
'test_cext',
97107
'test_clinic',
@@ -121,6 +131,20 @@
121131
if not(sys.platform in ("linux", "darwin") or support.MS_WINDOWS):
122132
# Need Py_SUPPORTS_REMOTE_DEBUG macro
123133
EXPECTED_SKIP.add('test_remote_pdb')
134+
if not sysconfig.is_python_build():
135+
# Skip tests on installed Python.
136+
# Tests only relevant for from-source Python builds
137+
EXPECTED_SKIP |= {
138+
# Parser/asdl.py is not installed
139+
'test_asdl_parser',
140+
# Tools/clinic/ is not installed
141+
'test_clinic',
142+
# Tools/cases_generator is not installed
143+
'test_generated_cases',
144+
}
145+
if not sysconfig.get_config_var('WITH_DTRACE'):
146+
# Need ./configure --with-dtrace
147+
EXPECTED_SKIP.add('test_dtrace')
124148

125149
if support.MS_WINDOWS:
126150
# Tests specific to non-Windows platforms
@@ -171,6 +195,11 @@
171195

172196
if not support.is_android:
173197
EXPECTED_SKIP.add('test_android')
198+
# _multiprocessing is not available on Android
199+
EXPECTED_SKIP |= NEED_MULTIPROCESSING
200+
# _tkinter is not available on Android
201+
EXPECTED_SKIP |= NEED_TKINTER
202+
174203
if not support.is_apple:
175204
EXPECTED_SKIP.add('test_apple')
176205

@@ -181,7 +210,10 @@
181210
'test_grp', # need grp
182211
'test_syslog', # need syslog
183212
}
213+
# configure disables _multiprocessing on Apple mobile
184214
EXPECTED_SKIP |= NEED_MULTIPROCESSING
215+
# configure disables _tkinter on Apple mobile
216+
EXPECTED_SKIP |= NEED_TKINTER
185217

186218
if support.is_emscripten:
187219
# configure disables multiple extension modules on Emscripten
@@ -195,12 +227,18 @@
195227
'test_resource', # need resource
196228
'test_syslog', # need syslog
197229
}
230+
# configure disables _multiprocessing on Emscripten
231+
EXPECTED_SKIP |= NEED_MULTIPROCESSING
198232
EXPECTED_SKIP |= {
199233
# Incompatible with Emscripten's mmap emulation
200234
'test_mmap',
201235
# Cannot create socketpair on Emscripten/WASI
202236
'test_selectors',
203237
}
238+
# Missing OpenSSL dependency on Emscripten
239+
EXPECTED_SKIP |= NEED_SSL
240+
# Missing Tcl/Tk dependency on Emscripten
241+
EXPECTED_SKIP |= NEED_TKINTER
204242

205243
if support.is_android or support.is_apple_mobile or support.is_wasm32 or IS_WASI:
206244
EXPECTED_SKIP |= {
@@ -252,6 +290,10 @@
252290
EXPECTED_SKIP |= NEED_TESTMULTIPHASE
253291
# Missing OpenSSL dependency on WASI
254292
EXPECTED_SKIP |= NEED_SSL
293+
# Missing Tcl/Tk dependency on WASI
294+
EXPECTED_SKIP |= NEED_TKINTER
295+
# Missing libreadline/libedit dependency on Emscripten
296+
EXPECTED_SKIP.add('readline')
255297

256298

257299
def expected_to_be_skipped(test_name):
@@ -281,20 +323,10 @@ def expected_to_be_skipped(test_name):
281323
name = test_name.removeprefix('test_')
282324
return not hasattr(select, name)
283325

284-
if test_name == 'test_dtrace':
285-
# Need ./configure --with-dtrace
286-
import sysconfig
287-
return not sysconfig.get_config_var('WITH_DTRACE')
288-
289326
if test_name in ('test_perf_profiler', 'test_perfmaps', 'test_samply_profiler'):
290327
# Need perf trampoline profiling: configure defines the
291328
# PY_HAVE_PERF_TRAMPOLINE macro on Linux (x86-64 and AArch64)
292329
# and on macOS.
293330
return not support.supports_perf_trampoline_profiling()
294331

295-
if test_name == 'test_asdl_parser':
296-
# Test only relevant for from-source Python builds
297-
import sysconfig
298-
return not sysconfig.is_python_build()
299-
300332
return False

0 commit comments

Comments
 (0)