def METHOD_NAME(http_request):
    def test_callback(response):
        raise ValueError()
    def test_callback_request(response):
        raise TypeError()
    transport = mock.MagicMock(spec=HttpTransport)
    url = "http://localhost"
    custom_hook_policy = CustomHookPolicy(raw_request_hook=test_callback)
    policies = [UserAgentPolicy("myuseragent"), custom_hook_policy]
    client = PipelineClient(base_url=url, policies=policies, transport=transport)
    request = http_request("GET", url)
    with pytest.raises(TypeError):
        client._pipeline.run(request, raw_request_hook=test_callback_request)