8000 gh-120579: Guard `_testcapi` import in `test_free_threading` by sobolevn · Pull Request #120580 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120579: Guard _testcapi import in test_free_threading #120580

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

Merged
merged 1 commit into from
Jun 16, 2024
Merged
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
gh-120579: Guard _testcapi import in test_free_threading
  • Loading branch information
sobolevn committed Jun 16, 2024
commit a867c254fb07d221d779861a3f6ef0ad770dd170
7 changes: 6 additions & 1 deletion Lib/test/test_free_threading/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = []
Expand Down
Loading
0