def test_function_with_self():
    """Test that functions using 'self' raise an exception."""

    def func_with_self(self, a: int) -> int:
        """
        Example function with 'self'.

        Args:
            a: The integer parameter
        """
        return a * 2

    with pytest.raises(
        ValueError, match="Parameter 'self' is not allowed in the function signature"
    ):
        generate_sql_function_body(func_with_self, "test_catalog", "test_schema")
Test that functions using 'self' raise an exception.
ai/core/tests/core/test_callable_utils.py