import unittest from ctypes import * import _ctypes_test class S(unittest.TestCase): def testr(s): s = "a" dll = CDLL(_ctypes_test.__file__) dll.my_wcsdup.restype = POINTER(c_char) dll.my_wcsdup.argtypes=dll.my_wcsdup(s) if __name__=="__main__":unittest.main()