import unittest
from test.test_support import run_unittest, import_module
#Skip tests if _ctypes module does not exist
import_module('_ctypes')
import ctypes.test
def test_main():
skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
suites = [unittest.makeSuite(t) for t in testcases]
run_unittest(unittest.TestSuite(suites))
if __name__ == "__main__":
test_main()
-
R. David Murray yazdı
should cause tests to be skipped. Also rename import_function to the more descriptive get_attribute and add a docstring.
3db8a343