mirror of https://github.com/python/cpython.git
gh-124402: Require cpu resource in test_free_threading (#124438)
Require the 'cpu' test resource on slow test_free_threading tests.
This commit is contained in:
parent
d21b0b5d36
commit
38a5beb12a
|
@ -3,6 +3,7 @@
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from test import support
|
||||||
from test.support import threading_helper
|
from test.support import threading_helper
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ def __init__(self, v):
|
||||||
|
|
||||||
@threading_helper.requires_working_threading()
|
@threading_helper.requires_working_threading()
|
||||||
class TestList(TestCase):
|
class TestList(TestCase):
|
||||||
|
@support.requires_resource('cpu')
|
||||||
def test_racing_iter_append(self):
|
def test_racing_iter_append(self):
|
||||||
|
|
||||||
l = []
|
l = []
|
||||||
|
@ -42,6 +44,7 @@ def reader_func():
|
||||||
for reader in readers:
|
for reader in readers:
|
||||||
reader.join()
|
reader.join()
|
||||||
|
|
||||||
|
@support.requires_resource('cpu')
|
||||||
def test_racing_iter_extend(self):
|
def test_racing_iter_extend(self):
|
||||||
iters = [
|
iters = [
|
||||||
lambda x: [x],
|
lambda x: [x],
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
from sys import monitoring
|
from sys import monitoring
|
||||||
|
from test import support
|
||||||
from test.support import threading_helper
|
from test.support import threading_helper
|
||||||
from threading import Thread, _PyRLock
|
from threading import Thread, _PyRLock
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
@ -43,6 +44,7 @@ def after_test(self):
|
||||||
"""Runs once after the test is done"""
|
"""Runs once after the test is done"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@support.requires_resource('cpu')
|
||||||
def test_instrumentation(self):
|
def test_instrumentation(self):
|
||||||
# Setup a bunch of functions which will need instrumentation...
|
# Setup a bunch of functions which will need instrumentation...
|
||||||
funcs = []
|
funcs = []
|
||||||
|
@ -218,6 +220,7 @@ def test_register_callback(self):
|
||||||
for ref in self.refs:
|
for ref in self.refs:
|
||||||
self.assertEqual(ref(), None)
|
self.assertEqual(ref(), None)
|
||||||
|
|
||||||
|
@support.requires_resource('cpu')
|
||||||
def test_set_local_trace_opcodes(self):
|
def test_set_local_trace_opcodes(self):
|
||||||
def trace(frame, event, arg):
|
def trace(frame, event, arg):
|
||||||
frame.f_trace_opcodes = True
|
frame.f_trace_opcodes = True
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from test import support
|
||||||
from test.support import threading_helper
|
from test.support import threading_helper
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ def reader_func():
|
||||||
|
|
||||||
self.run_one(writer_func, reader_func)
|
self.run_one(writer_func, reader_func)
|
||||||
|
|
||||||
|
@support.requires_resource('cpu')
|
||||||
def test___class___modification(self):
|
def test___class___modification(self):
|
||||||
class Foo:
|
class Foo:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue