Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-124402: Require cpu resource in test_free_threading #124438

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/test/test_free_threading/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from threading import Thread
from unittest import TestCase

from test import support
from test.support import threading_helper


Expand All @@ -13,6 +14,7 @@ def __init__(self, v):

@threading_helper.requires_working_threading()
class TestList(TestCase):
@support.requires_resource('cpu')
def test_racing_iter_append(self):

l = []
Expand Down Expand Up @@ -42,6 +44,7 @@ def reader_func():
for reader in readers:
reader.join()

@support.requires_resource('cpu')
def test_racing_iter_extend(self):
iters = [
lambda x: [x],
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_free_threading/test_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import weakref

from sys import monitoring
from test import support
from test.support import threading_helper
from threading import Thread, _PyRLock
from unittest import TestCase
Expand Down Expand Up @@ -43,6 +44,7 @@ def after_test(self):
"""Runs once after the test is done"""
pass

@support.requires_resource('cpu')
def test_instrumentation(self):
# Setup a bunch of functions which will need instrumentation...
funcs = []
Expand Down Expand Up @@ -218,6 +220,7 @@ def test_register_callback(self):
for ref in self.refs:
self.assertEqual(ref(), None)

@support.requires_resource('cpu')
def test_set_local_trace_opcodes(self):
def trace(frame, event, arg):
frame.f_trace_opcodes = True
Expand Down
2 changes: 2 additions & 0 deletions Lib/test/test_free_threading/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from threading import Thread
from unittest import TestCase

from test import support
from test.support import threading_helper


Expand Down Expand Up @@ -96,6 +97,7 @@ def reader_func():

self.run_one(writer_func, reader_func)

@support.requires_resource('cpu')
def test___class___modification(self):
class Foo:
pass
Expand Down
Loading