示例#1
0
    def test_to_ctypes(self):
        """
        Test converting a Numba type to a ctypes type.
        """
        def check(cty, ty):
            got = ctypes_utils.to_ctypes(ty)
            self.assertEqual(got, cty)

        self._conversion_tests(check)

        # An unsupported type
        with self.assertRaises(TypeError) as raises:
            ctypes_utils.to_ctypes(types.ellipsis)
        self.assertIn("Cannot convert Numba type '...' to ctypes type",
                      str(raises.exception))
示例#2
0
    def test_to_ctypes(self):
        """
        Test converting a Numba type to a ctypes type.
        """
        def check(cty, ty):
            got = ctypes_utils.to_ctypes(ty)
            self.assertEqual(got, cty)

        self._conversion_tests(check)

        # An unsupported type
        with self.assertRaises(TypeError) as raises:
            ctypes_utils.to_ctypes(types.ellipsis)
        self.assertIn("Cannot convert Numba type '...' to ctypes type",
                      str(raises.exception))
示例#3
0
 def check(cty, ty):
     got = ctypes_utils.to_ctypes(ty)
     self.assertEqual(got, cty)
示例#4
0
 def check(cty, ty):
     got = ctypes_utils.to_ctypes(ty)
     self.assertEqual(got, cty)