mirror of
https://github.com/python/cpython.git
synced 2026-04-27 22:31:21 +00:00
[3.13] gh-120579: Guard _testcapi import in test_free_threading (GH-120580) (#120583)
gh-120579: Guard `_testcapi` import in `test_free_threading` (GH-120580)
(cherry picked from commit 0c0348adbf)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
eee2c45633
commit
f2a4540c4f
1 changed files with 6 additions and 1 deletions
|
|
@ -8,7 +8,10 @@
|
|||
from threading import Thread
|
||||
from unittest import TestCase
|
||||
|
||||
from _testcapi import dict_version
|
||||
try:
|
||||
import _testcapi
|
||||
except ImportError:
|
||||
_testcapi = None
|
||||
|
||||
from test.support import threading_helper
|
||||
|
||||
|
|
@ -139,7 +142,9 @@ def writer_func(l):
|
|||
for ref in thread_list:
|
||||
self.assertIsNone(ref())
|
||||
|
||||
@unittest.skipIf(_testcapi is None, 'need _testcapi module')
|
||||
def test_dict_version(self):
|
||||
dict_version = _testcapi.dict_version
|
||||
THREAD_COUNT = 10
|
||||
DICT_COUNT = 10000
|
||||
lists = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue