1import os 2import unittest 3from test import support 4from test.support import import_helper 5 6 7# skip tests if _ctypes was not built 8ctypes = import_helper.import_module('ctypes') 9ctypes_symbols = dir(ctypes) 10 11def need_symbol(name): 12 return unittest.skipUnless(name in ctypes_symbols, 13 '{!r} is required'.format(name)) 14 15def load_tests(*args): 16 return support.load_package_tests(os.path.dirname(__file__), *args) 17