From: Carlos Henrique Lima Melara Date: Fri, 6 Mar 2026 03:56:17 +0000 (-0300) Subject: Make tests compatible with curl 8.19.0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3582%2Fhead;p=thirdparty%2Ftornado.git Make tests compatible with curl 8.19.0 In 8.19.0-rc2, the error logic has been changed so any later errors are preserved. This changes what is returned by curl and therefore what tornado sees. For HTTPError variant of the test, which uses CurlAsyncHTTPClient, we get the error from pycurl and now it contains "Failed binding local connection end". This logic handles both the old version of libcurl and also the newer one. Co-Authored-By: Samuel Henrique --- diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index 77c0d6eb..caed23e0 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -622,7 +622,10 @@ X-XSS-Protection: 1; with self.assertRaises((ValueError, HTTPError)) as context: # type: ignore request = HTTPRequest(url, network_interface="not-interface-or-ip") yield self.http_client.fetch(request) - self.assertIn("not-interface-or-ip", str(context.exception)) + self.assertTrue( + "Failed binding local connection end" in str(context.exception) + or "not-interface-or-ip" in str(context.exception) + ) def test_all_methods(self): for method in ["GET", "DELETE", "OPTIONS"]: