Skip to content

Commit 0f6f74e

Browse files
Skip more tests
- Lib/test/support/__init__.py - Lib/test/test_audit.py - Lib/test/test_gdb/test_misc.py - Lib/test/test_inspect/test_inspect.py - Lib/test/test_pydoc/test_pydoc.py
1 parent 9b3f0f7 commit 0f6f74e

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

Lib/test/support/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,7 @@ def patch_list(orig):
16981698
orig[:] = saved
16991699

17001700

1701+
@requires_limited_api
17011702
def run_in_subinterp(code):
17021703
"""
17031704
Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc

Lib/test/test_audit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from test import support
88
from test.support import import_helper
99
from test.support import os_helper
10+
from test.support import requires_limited_api
1011

1112

1213
if not hasattr(sys, "addaudithook") or not hasattr(sys, "audit"):
@@ -88,6 +89,7 @@ def test_excepthook(self):
8889
[("sys.excepthook", " ", "RuntimeError('fatal-error')")], events
8990
)
9091

92+
@requires_limited_api
9193
def test_unraisablehook(self):
9294
returncode, events, stderr = self.run_python("test_unraisablehook")
9395
if returncode:

Lib/test/test_gdb/test_misc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
import unittest
3-
from test.support import python_is_optimized
3+
from test.support import python_is_optimized, requires_limited_api
44

55
from .util import run_gdb, setup_module, DebuggerTests, SAMPLE_SCRIPT
66

@@ -85,6 +85,7 @@ def baz(*args):
8585

8686

8787
class StackNavigationTests(DebuggerTests):
88+
@requires_limited_api
8889
@unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
8990
@unittest.skipIf(python_is_optimized(),
9091
"Python was compiled with optimizations")
@@ -114,6 +115,7 @@ def test_up_at_top(self):
114115
self.assertEndsWith(bt,
115116
'Unable to find an older python frame\n')
116117

118+
@requires_limited_api
117119
@unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
118120
@unittest.skipIf(python_is_optimized(),
119121
"Python was compiled with optimizations")
@@ -129,6 +131,7 @@ def test_up_then_down(self):
129131
$''')
130132

131133
class PyPrintTests(DebuggerTests):
134+
@requires_limited_api
132135
@unittest.skipIf(python_is_optimized(),
133136
"Python was compiled with optimizations")
134137
def test_basic_command(self):
@@ -138,6 +141,7 @@ def test_basic_command(self):
138141
self.assertMultilineMatches(bt,
139142
r".*\nlocal 'args' = \(1, 2, 3\)\n.*")
140143

144+
@requires_limited_api
141145
@unittest.skipIf(python_is_optimized(),
142146
"Python was compiled with optimizations")
143147
@unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")

Lib/test/test_inspect/test_inspect.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
except ImportError:
3333
ThreadPoolExecutor = None
3434

35-
from test.support import cpython_only
35+
from test.support import cpython_only, requires_limited_api
3636
from test.support import MISSING_C_DOCSTRINGS, ALWAYS_EQ
3737
from test.support.import_helper import DirsOnSysPath, ready_to_import
3838
from test.support.os_helper import TESTFN
@@ -668,7 +668,10 @@ def test_cleandoc(self):
668668

669669
@cpython_only
670670
def test_c_cleandoc(self):
671-
import _testinternalcapi
671+
try:
672+
import _testinternalcapi
673+
except ImportError:
674+
return unittest.skip("requires _testinternalcapi")
672675
func = _testinternalcapi.compiler_cleandoc
673676
for i, (input, expected) in enumerate(self.cleandoc_testdata):
674677
with self.subTest(i=i):
@@ -1200,6 +1203,7 @@ def test_getfullargspec_builtin_methods(self):
12001203
@cpython_only
12011204
@unittest.skipIf(MISSING_C_DOCSTRINGS,
12021205
"Signature information for builtins requires docstrings")
1206+
@requires_limited_api
12031207
def test_getfullargspec_builtin_func(self):
12041208
import _testcapi
12051209
builtin = _testcapi.docstring_with_signature_with_defaults
@@ -1209,6 +1213,7 @@ def test_getfullargspec_builtin_func(self):
12091213
@cpython_only
12101214
@unittest.skipIf(MISSING_C_DOCSTRINGS,
12111215
"Signature information for builtins requires docstrings")
1216+
@requires_limited_api
12121217
def test_getfullargspec_builtin_func_no_signature(self):
12131218
import _testcapi
12141219
builtin = _testcapi.docstring_no_signature
@@ -2870,6 +2875,7 @@ def test_staticmethod(*args): # NOQA
28702875
@cpython_only
28712876
@unittest.skipIf(MISSING_C_DOCSTRINGS,
28722877
"Signature information for builtins requires docstrings")
2878+
@requires_limited_api
28732879
def test_signature_on_builtins(self):
28742880
import _testcapi
28752881

@@ -2951,6 +2957,7 @@ class ThisWorksNow:
29512957
@cpython_only
29522958
@unittest.skipIf(MISSING_C_DOCSTRINGS,
29532959
"Signature information for builtins requires docstrings")
2960+
@requires_limited_api
29542961
def test_signature_on_decorated_builtins(self):
29552962
import _testcapi
29562963
func = _testcapi.docstring_with_signature_with_defaults
@@ -2972,6 +2979,7 @@ def wrapper_like(*args, **kwargs) -> int: pass
29722979
inspect.signature(wrapper_like))
29732980

29742981
@cpython_only
2982+
@requires_limited_api
29752983
def test_signature_on_builtins_no_signature(self):
29762984
import _testcapi
29772985
with self.assertRaisesRegex(ValueError,

Lib/test/test_pydoc/test_pydoc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,7 @@ def test_bound_builtin_classmethod_o(self):
13711371

13721372
@support.cpython_only
13731373
@requires_docstrings
1374+
@support.requires_limited_api
13741375
def test_module_level_callable_unrepresentable_default(self):
13751376
import _testcapi
13761377
builtin = _testcapi.func_with_unrepresentable_signature
@@ -1379,6 +1380,7 @@ def test_module_level_callable_unrepresentable_default(self):
13791380

13801381
@support.cpython_only
13811382
@requires_docstrings
1383+
@support.requires_limited_api
13821384
def test_builtin_staticmethod_unrepresentable_default(self):
13831385
self.assertEqual(self._get_summary_line(str.maketrans),
13841386
"maketrans(x, y=<unrepresentable>, z=<unrepresentable>, /)")
@@ -1389,6 +1391,7 @@ def test_builtin_staticmethod_unrepresentable_default(self):
13891391

13901392
@support.cpython_only
13911393
@requires_docstrings
1394+
@support.requires_limited_api
13921395
def test_unbound_builtin_method_unrepresentable_default(self):
13931396
self.assertEqual(self._get_summary_line(dict.pop),
13941397
"pop(self, key, default=<unrepresentable>, /) "
@@ -1401,6 +1404,7 @@ def test_unbound_builtin_method_unrepresentable_default(self):
14011404

14021405
@support.cpython_only
14031406
@requires_docstrings
1407+
@support.requires_limited_api
14041408
def test_bound_builtin_method_unrepresentable_default(self):
14051409
self.assertEqual(self._get_summary_line({}.pop),
14061410
"pop(key, default=<unrepresentable>, /) "
@@ -1413,6 +1417,7 @@ def test_bound_builtin_method_unrepresentable_default(self):
14131417

14141418
@support.cpython_only
14151419
@requires_docstrings
1420+
@support.requires_limited_api
14161421
def test_unbound_builtin_classmethod_unrepresentable_default(self):
14171422
import _testcapi
14181423
cls = _testcapi.DocStringUnrepresentableSignatureTest
@@ -1423,6 +1428,7 @@ def test_unbound_builtin_classmethod_unrepresentable_default(self):
14231428

14241429
@support.cpython_only
14251430
@requires_docstrings
1431+
@support.requires_limited_api
14261432
def test_bound_builtin_classmethod_unrepresentable_default(self):
14271433
import _testcapi
14281434
cls = _testcapi.DocStringUnrepresentableSignatureTest

0 commit comments

Comments
 (0)