test_ctypes.py 615 Bytes
Newer Older
1
import unittest
2

3
from test.test_support import run_unittest, import_module, check_py3k_warnings
4 5 6
#Skip tests if _ctypes module does not exist
import_module('_ctypes')

7 8

def test_main():
9 10 11 12 13 14
    with check_py3k_warnings(("buffer.. not supported", DeprecationWarning),
                             ("classic (int|long) division", DeprecationWarning)):
        import ctypes.test
        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))
15 16 17

if __name__ == "__main__":
    test_main()