aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index e122fe0b333..72b7765853b 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -19,6 +19,7 @@ import gc
from weakref import proxy
import contextlib
+from test.support import threading_helper
from test.support.script_helper import assert_python_ok
import functools
@@ -1798,7 +1799,7 @@ class TestLRU:
# create n threads in order to fill cache
threads = [threading.Thread(target=full, args=[k])
for k in range(n)]
- with support.start_threads(threads):
+ with threading_helper.start_threads(threads):
start.set()
hits, misses, maxsize, currsize = f.cache_info()
@@ -1816,7 +1817,7 @@ class TestLRU:
threads += [threading.Thread(target=full, args=[k])
for k in range(n)]
start.clear()
- with support.start_threads(threads):
+ with threading_helper.start_threads(threads):
start.set()
finally:
sys.setswitchinterval(orig_si)
@@ -1838,7 +1839,7 @@ class TestLRU:
self.assertEqual(f(i), 3 * i)
stop.wait(10)
threads = [threading.Thread(target=test) for k in range(n)]
- with support.start_threads(threads):
+ with threading_helper.start_threads(threads):
for i in range(m):
start.wait(10)
stop.reset()
@@ -1858,7 +1859,7 @@ class TestLRU:
self.assertEqual(f(x), 3 * x, i)
threads = [threading.Thread(target=test, args=(i, v))
for i, v in enumerate([1, 2, 2, 3, 2])]
- with support.start_threads(threads):
+ with threading_helper.start_threads(threads):
pass
def test_need_for_rlock(self):
@@ -2792,7 +2793,7 @@ class TestCachedProperty(unittest.TestCase):
threading.Thread(target=lambda: item.cost)
for k in range(num_threads)
]
- with support.start_threads(threads):
+ with threading_helper.start_threads(threads):
go.set()
finally:
sys.setswitchinterval(orig_si)