def test_array_to_scalar(self):
        """
        Ensure that a TypingError exception is raised if
        user tries to convert numpy array to scalar
        """

        with self.assertRaises(TypingError) as raises:
            njit(())(numpy_scalar_cast_error)

        self.assertIn("Casting array(float64, 1d, C) to int32 directly is unsupported.",
                      str(raises.exception))

        Ensure that a TypingError exception is raised if
        user tries to convert numpy array to scalar
        
numba/tests/test_casting.py