]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Make tests compatible with curl 8.19.0 3582/head
authorCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Fri, 6 Mar 2026 03:56:17 +0000 (00:56 -0300)
committerCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Thu, 12 Mar 2026 01:26:03 +0000 (22:26 -0300)
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 <samueloph@debian.org>
tornado/test/httpclient_test.py

index 77c0d6eb9bfb204c1580509b57238a655cab08da..caed23e0452815febb6039f2459503285f701ef7 100644 (file)
@@ -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"]: