]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 2 Sep 2023 23:22:33 +0000 (16:22 -0700)
committerGitHub <noreply@github.com>
Sat, 2 Sep 2023 23:22:33 +0000 (01:22 +0200)
gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)

Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
32 files changed:
Lib/test/_test_multiprocessing.py
Lib/test/pickletester.py
Lib/test/test_ast.py
Lib/test/test_buffer.py
Lib/test/test_builtin.py
Lib/test/test_compile.py
Lib/test/test_compileall.py
Lib/test/test_concurrent_futures/test_thread_pool.py
Lib/test/test_context.py
Lib/test/test_cppext/__init__.py
Lib/test/test_descr.py
Lib/test/test_email/test_email.py
Lib/test/test_exceptions.py
Lib/test/test_gdb.py
Lib/test/test_interpreters.py
Lib/test/test_itertools.py
Lib/test/test_largefile.py
Lib/test/test_multibytecodec.py
Lib/test/test_peepholer.py
Lib/test/test_runpy.py
Lib/test/test_selectors.py
Lib/test/test_source_encoding.py
Lib/test/test_statistics.py
Lib/test/test_subprocess.py
Lib/test/test_support.py
Lib/test/test_sys_settrace.py
Lib/test/test_tools/test_freeze.py
Lib/test/test_trace.py
Lib/test/test_traceback.py
Lib/test/test_unicodedata.py
Lib/test/test_venv.py
Lib/test/test_weakref.py

index c1e18dd69294b17c9d65d659c18aee48a795e9d0..2e656538e99f3eaab759bc19894ec276c0639893 100644 (file)
@@ -329,6 +329,7 @@ class _TestProcess(BaseTestCase):
             p.join()
             self.assertEqual(p.exitcode, 0)
 
+    @support.requires_resource('cpu')
     def test_args_argument(self):
         # bpo-45735: Using list or tuple as *args* in constructor could
         # achieve the same effect.
@@ -4466,6 +4467,7 @@ class _TestFinalize(BaseTestCase):
         result = [obj for obj in iter(conn.recv, 'STOP')]
         self.assertEqual(result, ['a', 'b', 'd10', 'd03', 'd02', 'd01', 'e'])
 
+    @support.requires_resource('cpu')
     def test_thread_safety(self):
         # bpo-24484: _run_finalizers() should be thread-safe
         def cb():
index 6e87370c2065ba531fb9938b2132a432f9fd7250..a687fe0629080a88ec8532ef4644eced7145144c 100644 (file)
@@ -2576,6 +2576,7 @@ class AbstractPickleTests:
             self.assertLess(pos - frameless_start, self.FRAME_SIZE_MIN)
 
     @support.skip_if_pgo_task
+    @support.requires_resource('cpu')
     def test_framing_many_objects(self):
         obj = list(range(10**5))
         for proto in range(4, pickle.HIGHEST_PROTOCOL + 1):
index 5346b39043f0f5c156e36887a7fd0368eba700eb..3ba7cf7b04266fc077a71ee7d7ca84b81602538a 100644 (file)
@@ -1999,6 +1999,7 @@ class ASTValidatorTests(unittest.TestCase):
             'ast.NameConstant is deprecated and will be removed in Python 3.14; use ast.Constant instead',
         ])
 
+    @support.requires_resource('cpu')
     def test_stdlib_validates(self):
         stdlib = os.path.dirname(ast.__file__)
         tests = [fn for fn in os.listdir(stdlib) if fn.endswith(".py")]
index 9f00bd5e76195fba92af96a591df6911bb2f51ba..aafbb8a993def53f2027168b2b7bd8274634a6e8 100644 (file)
@@ -1028,6 +1028,7 @@ class TestBufferProtocol(unittest.TestCase):
                     ndim=ndim, shape=shape, strides=strides,
                     lst=lst, sliced=sliced)
 
+    @support.requires_resource('cpu')
     def test_ndarray_getbuf(self):
         requests = (
             # distinct flags
@@ -2759,6 +2760,7 @@ class TestBufferProtocol(unittest.TestCase):
             m = memoryview(ex)
             iter_roundtrip(ex, m, items, fmt)
 
+    @support.requires_resource('cpu')
     def test_memoryview_cast_1D_ND(self):
         # Cast between C-contiguous buffers. At least one buffer must
         # be 1D, at least one format must be 'c', 'b' or 'B'.
index 1257b529038afb706e3e8afe7643063530f9d964..daac1008829b4cd51f0e56f25f54c2fc2c0ab9e3 100644 (file)
@@ -927,6 +927,7 @@ class BuiltinTest(unittest.TestCase):
             f2 = filter(filter_char, "abcdeabcde")
             self.check_iter_pickle(f1, list(f2), proto)
 
+    @support.requires_resource('cpu')
     def test_filter_dealloc(self):
         # Tests recursive deallocation of nested filter objects using the
         # thrashcan mechanism. See gh-102356 for more details.
index 55e55c7d2884d069c883d7a1e2dd7f908eeec58a..19b5aebdd381983075f572cf1487969f51dfa4f1 100644 (file)
@@ -784,6 +784,7 @@ class TestSpecifics(unittest.TestCase):
         # An implicit test for PyUnicode_FSDecoder().
         compile("42", FakePath("test_compile_pathlike"), "single")
 
+    @support.requires_resource('cpu')
     def test_stack_overflow(self):
         # bpo-31113: Stack overflow when compile a long sequence of
         # complex statements.
index 05154c8f1c6057169bf26730f71f17d2407e4c77..df7c5122b3b1f5316a043dd63966e4520b2c2b5a 100644 (file)
@@ -551,6 +551,7 @@ class CommandLineTestsBase:
             self.assertNotCompiled(self.barfn)
 
     @without_source_date_epoch  # timestamp invalidation test
+    @support.requires_resource('cpu')
     def test_no_args_respects_force_flag(self):
         bazfn = script_helper.make_script(self.directory, 'baz', '')
         with self.temporary_pycache_prefix() as env:
@@ -568,6 +569,7 @@ class CommandLineTestsBase:
         mtime2 = os.stat(pycpath).st_mtime
         self.assertNotEqual(mtime, mtime2)
 
+    @support.requires_resource('cpu')
     def test_no_args_respects_quiet_flag(self):
         script_helper.make_script(self.directory, 'baz', '')
         with self.temporary_pycache_prefix() as env:
index daef7b5a836825b8598b255cc8537b66f9e186c6..812f989d8f3ad2deae2bbd107f9c95acc17dd602 100644 (file)
@@ -6,6 +6,7 @@ import os
 import threading
 import unittest
 from concurrent import futures
+from test import support
 
 from .executor import ExecutorTest, mul
 from .util import BaseTestCase, ThreadPoolMixin, setup_module
@@ -49,6 +50,7 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, BaseTestCase):
         executor.shutdown(wait=True)
 
     @unittest.skipUnless(hasattr(os, 'register_at_fork'), 'need os.register_at_fork')
+    @support.requires_resource('cpu')
     def test_hang_global_shutdown_lock(self):
         # bpo-45021: _global_shutdown_lock should be reinitialized in the child
         # process, otherwise it will never exit
index b1aece4f5c9c495b9fd8b74b8e0990e34d07fb45..dc6856509a40a01a85ec628bba165f545119499e 100644 (file)
@@ -6,6 +6,7 @@ import random
 import time
 import unittest
 import weakref
+from test import support
 from test.support import threading_helper
 
 try:
@@ -570,6 +571,7 @@ class HamtTest(unittest.TestCase):
 
         self.assertEqual({k.name for k in h.keys()}, {'C', 'D', 'E'})
 
+    @support.requires_resource('cpu')
     def test_hamt_stress(self):
         COLLECTION_SIZE = 7000
         TEST_ITERS_EVERY = 647
index f3d32a3c7612c9cfba614e23362c0a5065658657..a322f417a774f01f162b8cd82565f2f11f175581 100644 (file)
@@ -17,9 +17,11 @@ SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
 
 @support.requires_subprocess()
 class TestCPPExt(unittest.TestCase):
+    @support.requires_resource('cpu')
     def test_build_cpp11(self):
         self.check_build(False, '_testcpp11ext')
 
+    @support.requires_resource('cpu')
     def test_build_cpp03(self):
         self.check_build(True, '_testcpp03ext')
 
index ad3eefba365856504439fce03ec03a66fe9d1bed..9d8b1497330f0a6d840c59a0f9584f2145187fb1 100644 (file)
@@ -4457,6 +4457,7 @@ order (MRO) for bases """
         o.whatever = Provoker(o)
         del o
 
+    @support.requires_resource('cpu')
     def test_wrapper_segfault(self):
         # SF 927248: deeply nested wrappers could cause stack overflow
         f = lambda:None
index cdb6ef1275e52063344ab08802ed661da52cbe68..2a237095b9080cab892f15f55c65db4c6466362a 100644 (file)
@@ -38,6 +38,7 @@ from email import iterators
 from email import quoprimime
 from email import utils
 
+from test import support
 from test.support import threading_helper
 from test.support.os_helper import unlink
 from test.test_email import openfile, TestEmailBase
@@ -3358,6 +3359,7 @@ Foo
         self.assertEqual(addrs[0][1], 'aperson@dom.ain')
 
     @threading_helper.requires_working_threading()
+    @support.requires_resource('cpu')
     def test_make_msgid_collisions(self):
         # Test make_msgid uniqueness, even with multiple threads
         class MsgidsThread(Thread):
index f3554f1c4bb3f38df0a5c3778f5051add196e795..72afb3b0fb03f8984eeb594d917fdf9330fb13c2 100644 (file)
@@ -1350,6 +1350,7 @@ class ExceptionTests(unittest.TestCase):
 
 
     @cpython_only
+    @support.requires_resource('cpu')
     def test_trashcan_recursion(self):
         # See bpo-33930
 
index 311a864a52387d2a4acf7a7d10ec12462a9a551a..78d602873fd86ff223465d08667db582c7f901e7 100644 (file)
@@ -317,6 +317,7 @@ class PrettyPrintTests(DebuggerTests):
                          ('%r did not equal expected %r; full output was:\n%s'
                           % (gdb_repr, exp_repr, gdb_output)))
 
+    @support.requires_resource('cpu')
     def test_int(self):
         'Verify the pretty-printing of various int values'
         self.assertGdbRepr(42)
@@ -343,6 +344,7 @@ class PrettyPrintTests(DebuggerTests):
         self.assertGdbRepr([])
         self.assertGdbRepr(list(range(5)))
 
+    @support.requires_resource('cpu')
     def test_bytes(self):
         'Verify the pretty-printing of bytes'
         self.assertGdbRepr(b'')
@@ -357,6 +359,7 @@ class PrettyPrintTests(DebuggerTests):
 
         self.assertGdbRepr(bytes([b for b in range(255)]))
 
+    @support.requires_resource('cpu')
     def test_strings(self):
         'Verify the pretty-printing of unicode strings'
         # We cannot simply call locale.getpreferredencoding() here,
@@ -407,6 +410,7 @@ class PrettyPrintTests(DebuggerTests):
         self.assertGdbRepr((1,), '(1,)')
         self.assertGdbRepr(('foo', 'bar', 'baz'))
 
+    @support.requires_resource('cpu')
     def test_sets(self):
         'Verify the pretty-printing of sets'
         if (gdb_major_version, gdb_minor_version) < (7, 3):
@@ -425,6 +429,7 @@ s.remove('a')
 id(s)''')
         self.assertEqual(gdb_repr, "{'b'}")
 
+    @support.requires_resource('cpu')
     def test_frozensets(self):
         'Verify the pretty-printing of frozensets'
         if (gdb_major_version, gdb_minor_version) < (7, 3):
@@ -828,6 +833,7 @@ Traceback \(most recent call first\):
 
     @unittest.skipIf(python_is_optimized(),
                      "Python was compiled with optimizations")
+    @support.requires_resource('cpu')
     def test_threads(self):
         'Verify that "py-bt" indicates threads that are waiting for the GIL'
         cmd = '''
@@ -889,6 +895,7 @@ id(42)
 
     @unittest.skipIf(python_is_optimized(),
                      "Python was compiled with optimizations")
+    @support.requires_resource('cpu')
     # Some older versions of gdb will fail with
     #  "Cannot find new threads: generic error"
     # unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround
index 662eafa3b7a104cf3cffb0f22f83b5c4c3accd58..27a143c7f5f38d2c32398053852affd002f03d56 100644 (file)
@@ -470,12 +470,14 @@ class StressTests(TestBase):
     # In these tests we generally want a lot of interpreters,
     # but not so many that any test takes too long.
 
+    @support.requires_resource('cpu')
     def test_create_many_sequential(self):
         alive = []
         for _ in range(100):
             interp = interpreters.create()
             alive.append(interp)
 
+    @support.requires_resource('cpu')
     def test_create_many_threaded(self):
         alive = []
         def task():
index 4d6ea780e153737a39f87fea0049b1950ae1f6cb..512745e45350d1094b0c6a08e7ae8ea5e31df3a9 100644 (file)
@@ -2401,6 +2401,7 @@ class RegressionTests(unittest.TestCase):
         self.assertEqual(hist, [0,1])
 
     @support.skip_if_pgo_task
+    @support.requires_resource('cpu')
     def test_long_chain_of_empty_iterables(self):
         # Make sure itertools.chain doesn't run into recursion limits when
         # dealing with long chains of empty iterables. Even with a high
index 3c11c59baef6e55c86a7c16bac2532f079fab8c1..3b0930fe69e30e8ba33ada442bbf798f2d8a0adc 100644 (file)
@@ -8,7 +8,7 @@ import unittest
 import socket
 import shutil
 import threading
-from test.support import requires, bigmemtest
+from test.support import requires, bigmemtest, requires_resource
 from test.support import SHORT_TIMEOUT
 from test.support import socket_helper
 from test.support.os_helper import TESTFN, unlink
@@ -173,6 +173,7 @@ class TestCopyfile(LargeFileTest, unittest.TestCase):
     # Exact required disk space would be (size * 2), but let's give it a
     # bit more tolerance.
     @skip_no_disk_space(TESTFN, size * 2.5)
+    @requires_resource('cpu')
     def test_it(self):
         # Internally shutil.copyfile() can use "fast copy" methods like
         # os.sendfile().
@@ -222,6 +223,7 @@ class TestSocketSendfile(LargeFileTest, unittest.TestCase):
     # Exact required disk space would be (size * 2), but let's give it a
     # bit more tolerance.
     @skip_no_disk_space(TESTFN, size * 2.5)
+    @requires_resource('cpu')
     def test_it(self):
         port = socket_helper.find_unused_port()
         with socket.create_server(("", port)) as sock:
index cf8bb5e3a0520d2cf7add7d29c584fe33605135e..6451df1469693343de004302a5c3a407901eb4d2 100644 (file)
@@ -363,6 +363,7 @@ class Test_ISO2022(unittest.TestCase):
             e = '\u3406'.encode(encoding)
             self.assertFalse(any(x > 0x80 for x in e))
 
+    @support.requires_resource('cpu')
     def test_bug1572832(self):
         for x in range(0x10000, 0x110000):
             # Any ISO 2022 codec will cause the segfault
index 255e92804214238cb0edcf786a75e8a66702e0ad..0aabce880053d6ded29f6a507ea9fa69372e1edb 100644 (file)
@@ -4,6 +4,7 @@ import sys
 import textwrap
 import unittest
 
+from test import support
 from test.support.bytecode_helper import BytecodeTestCase, CfgOptimizationTestCase
 
 
@@ -522,6 +523,7 @@ class TestTranforms(BytecodeTestCase):
             return (y for x in a for y in [f(x)])
         self.assertEqual(count_instr_recursively(genexpr, 'FOR_ITER'), 1)
 
+    @support.requires_resource('cpu')
     def test_format_combinations(self):
         flags = '-+ #0'
         testcases = [
index 6aaa288c14e1d70fb9e67a618b8246f3e9096624..628c8cae38a75194476a2d5fd37c1f09c42f83f6 100644 (file)
@@ -12,7 +12,7 @@ import tempfile
 import textwrap
 import unittest
 import warnings
-from test.support import no_tracing, verbose, requires_subprocess
+from test.support import no_tracing, verbose, requires_subprocess, requires_resource
 from test.support.import_helper import forget, make_legacy_pyc, unload
 from test.support.os_helper import create_empty_file, temp_dir
 from test.support.script_helper import make_script, make_zip_script
@@ -733,6 +733,7 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
             self._check_import_error(zip_name, msg)
 
     @no_tracing
+    @requires_resource('cpu')
     def test_main_recursion_error(self):
         with temp_dir() as script_dir, temp_dir() as dummy_dir:
             mod_name = '__main__'
index c2db88c203920a9d2c077fe58ccdc6d040ddaadb..12ecc50d550c4fc82ccc8a7e0f10ae519214da47 100644 (file)
@@ -449,6 +449,7 @@ class ScalableSelectorMixIn:
     # see issue #18963 for why it's skipped on older OS X versions
     @support.requires_mac_ver(10, 5)
     @unittest.skipUnless(resource, "Test needs resource module")
+    @support.requires_resource('cpu')
     def test_above_fd_setsize(self):
         # A scalable implementation should have no problem with more than
         # FD_SETSIZE file descriptors. Since we don't know the value, we just
index b05173ad00d4420f799a8f2d1e296898abc7a89e..72c2b47779e00533ecdef52a2d64bbd21571c5bb 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 import unittest
-from test.support import script_helper, captured_stdout, requires_subprocess
+from test.support import script_helper, captured_stdout, requires_subprocess, requires_resource
 from test.support.os_helper import TESTFN, unlink, rmtree
 from test.support.import_helper import unload
 import importlib
@@ -250,6 +250,7 @@ class AbstractSourceEncodingTest:
 class UTF8ValidatorTest(unittest.TestCase):
     @unittest.skipIf(not sys.platform.startswith("linux"),
                      "Too slow to run on non-Linux platforms")
+    @requires_resource('cpu')
     def test_invalid_utf8(self):
         # This is a port of test_utf8_decode_invalid_sequences in
         # test_unicode.py to exercise the separate utf8 validator in
index f0fa6454b1f91a70d0548c49b4587c1029126e8c..0080d9960409a8ab233b8639f36a7de54873a1ad 100644 (file)
@@ -2139,6 +2139,7 @@ class TestSqrtHelpers(unittest.TestCase):
             self.assertTrue(m * (r - 1)**2 < n < m * (r + 1)**2)
 
     @requires_IEEE_754
+    @support.requires_resource('cpu')
     def test_float_sqrt_of_frac(self):
 
         def is_root_correctly_rounded(x: Fraction, root: float) -> bool:
@@ -2770,6 +2771,7 @@ class TestNormalDist:
         self.assertTrue(math.isnan(X.cdf(float('NaN'))))
 
     @support.skip_if_pgo_task
+    @support.requires_resource('cpu')
     def test_inv_cdf(self):
         NormalDist = self.module.NormalDist
 
index 817eab0c8a7e19ddc3f3b5bd4bb647658caf3525..0b9e9e16f55d7ef122f3d615cf8faa9655968c88 100644 (file)
@@ -1292,6 +1292,7 @@ class ProcessTestCase(BaseTestCase):
         with self.assertWarnsRegex(RuntimeWarning, 'line buffering'):
             self._test_bufsize_equal_one(line, b'', universal_newlines=False)
 
+    @support.requires_resource('cpu')
     def test_leaking_fds_on_error(self):
         # see bug #5179: Popen leaks file descriptors to PIPEs if
         # the child fails to execute; this will eventually exhaust
index 85d692f3097494802a73255c3d34cffbed8b32d6..23c6bd226b5bf67bcbfea340fe468f0f6facb47a 100644 (file)
@@ -500,6 +500,7 @@ class TestSupport(unittest.TestCase):
         self.assertEqual(proc.stdout.rstrip(), repr(expected))
         self.assertEqual(proc.returncode, 0)
 
+    @support.requires_resource('cpu')
     def test_args_from_interpreter_flags(self):
         # Test test.support.args_from_interpreter_flags()
         for opts in (
index 5603c3cdbf3c5e1db754c9a51c2dca0d7243fdf7..59dd23348c866d824af4a4872ed205d255cd1248 100644 (file)
@@ -2812,6 +2812,7 @@ output.append(4)
         ) = output.append(4) or "Spam"
         output.append(5)
 
+    @support.requires_resource('cpu')
     def test_jump_extended_args_for_iter(self):
         # In addition to failing when extended arg handling is broken, this can
         # also hang for a *very* long time:
index 2ba36ca208f96733fd4ea597d5d895daf0ab2fdd..922e74b441457ab0ada2a58f0d5167d7d91e42eb 100644 (file)
@@ -17,6 +17,7 @@ with imports_under_tool('freeze', 'test'):
 @support.skip_if_buildbot('not all buildbots have enough space')
 class TestFreeze(unittest.TestCase):
 
+    @support.requires_resource('cpu') # Building Python is slow
     def test_freeze_simple_script(self):
         script = textwrap.dedent("""
             import sys
index 73339ebdb7c4e95be69354e6a20b8360f2a57e87..d1ef005a4314ed28565514042b563b8388c6d538 100644 (file)
@@ -1,7 +1,7 @@
 import os
 from pickle import dump
 import sys
-from test.support import captured_stdout
+from test.support import captured_stdout, requires_resource
 from test.support.os_helper import (TESTFN, rmtree, unlink)
 from test.support.script_helper import assert_python_ok, assert_python_failure
 import textwrap
@@ -367,6 +367,7 @@ class TestCoverage(unittest.TestCase):
         r = tracer.results()
         r.write_results(show_missing=True, summary=True, coverdir=TESTFN)
 
+    @requires_resource('cpu')
     def test_coverage(self):
         tracer = trace.Trace(trace=0, count=1)
         with captured_stdout() as stdout:
index 9476e2c89def49e2a32da8c151d57519d8e604af..7bfeda8dc95b0449c1324809ba8dc9ef6fc81f39 100644 (file)
@@ -3525,6 +3525,7 @@ class MiscTest(unittest.TestCase):
         CHECK("AttributeError", "AttributeErrorTests", 10)
         CHECK("ABA", "AAB", 4)
 
+    @support.requires_resource('cpu')
     def test_levenshtein_distance_short_circuit(self):
         if not LEVENSHTEIN_DATA_FILE.is_file():
             self.fail(
index 3dc0790ca15b416b1cf286b3f8094c5fb294705c..515c3840cb36474a39b1dae8cd4c78b639c1e365 100644 (file)
@@ -313,6 +313,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
         self.assertTrue("\u1d79".upper()=='\ua77d')
         self.assertTrue(".".upper()=='.')
 
+    @requires_resource('cpu')
     def test_bug_5828(self):
         self.assertEqual("\u1d79".lower(), "\u1d79")
         # Only U+0000 should have U+0000 as its upper/lower/titlecase variant
@@ -353,6 +354,7 @@ class NormalizationTest(unittest.TestCase):
         return "".join([chr(x) for x in data])
 
     @requires_resource('network')
+    @requires_resource('cpu')
     def test_normalization(self):
         TESTDATAFILE = "NormalizationTest.txt"
         TESTDATAURL = f"http://www.pythontest.net/unicode/{unicodedata.unidata_version}/{TESTDATAFILE}"
index 5205604c2c7185168c86bfd3d657f652decf3130..aa6a8fbf8cfd17e9a55a133745ad239ae5717863 100644 (file)
@@ -20,7 +20,8 @@ import tempfile
 from test.support import (captured_stdout, captured_stderr,
                           skip_if_broken_multiprocessing_synchronize, verbose,
                           requires_subprocess, is_emscripten, is_wasi,
-                          requires_venv_with_pip, TEST_HOME_DIR)
+                          requires_venv_with_pip, TEST_HOME_DIR,
+                          requires_resource)
 from test.support.os_helper import (can_symlink, EnvironmentVarGuard, rmtree)
 import unittest
 import venv
@@ -775,6 +776,7 @@ class EnsurePipTest(BaseTest):
             )
 
     @requires_venv_with_pip()
+    @requires_resource('cpu')
     def test_with_pip(self):
         self.do_test_with_pip(False)
         self.do_test_with_pip(True)
index 1bc1d05f7daba9de0d8a0215a9f49837ef834a1a..4cdd66d3769e0ca48beba9452098cd11d58b50b4 100644 (file)
@@ -1933,6 +1933,7 @@ class MappingTestCase(TestBase):
         self.check_threaded_weak_dict_copy(weakref.WeakKeyDictionary, False)
 
     @threading_helper.requires_working_threading()
+    @support.requires_resource('cpu')
     def test_threaded_weak_key_dict_deepcopy(self):
         # Issue #35615: Weakref keys or values getting GC'ed during dict
         # copying should not result in a crash.
@@ -1945,6 +1946,7 @@ class MappingTestCase(TestBase):
         self.check_threaded_weak_dict_copy(weakref.WeakValueDictionary, False)
 
     @threading_helper.requires_working_threading()
+    @support.requires_resource('cpu')
     def test_threaded_weak_value_dict_deepcopy(self):
         # Issue #35615: Weakref keys or values getting GC'ed during dict
         # copying should not result in a crash.