Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Skip test when _ctypes is not available
  • Loading branch information
encukou committed Jun 1, 2021
commit 39446ab6efb03dfb7fc6f196a4f83a5cae35c6c0
6 changes: 4 additions & 2 deletions Lib/test/test_stable_abi_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"""

import unittest
from ctypes import pythonapi
from test.support.import_helper import import_module

ctypes_test = import_module('ctypes')

class TestStableABIAvailability(unittest.TestCase):
def test_available_symbols(self):
for symbol_name in SYMBOL_NAMES:
with self.subTest(symbol_name):
pythonapi[symbol_name]
ctypes_test.pythonapi[symbol_name]

SYMBOL_NAMES = (

Expand Down
6 changes: 4 additions & 2 deletions Tools/scripts/stable_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ def gen_ctypes_test(manifest, args, outfile):
"""

import unittest
from ctypes import pythonapi
from test.support.import_helper import import_module

ctypes_test = import_module('ctypes')

class TestStableABIAvailability(unittest.TestCase):
def test_available_symbols(self):
for symbol_name in SYMBOL_NAMES:
with self.subTest(symbol_name):
pythonapi[symbol_name]
ctypes_test.pythonapi[symbol_name]

SYMBOL_NAMES = (
'''))
Expand Down