diff --git a/docs/caresresolver.rst b/docs/caresresolver.rst index 4e0058eac..57caa7d19 100644 --- a/docs/caresresolver.rst +++ b/docs/caresresolver.rst @@ -19,6 +19,9 @@ wrapper ``pycares``). the default for ``tornado.simple_httpclient``, but other libraries may default to ``AF_UNSPEC``. + This class requires ``pycares`` version 4. Since this class is deprecated, it will not be + updated to support ``pycares`` version 5. + .. deprecated:: 6.2 This class is deprecated and will be removed in Tornado 7.0. Use the default thread-based resolver instead. diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index ed06beaee..7fa528cdc 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -284,7 +284,7 @@ def test_disposition_param_linear_performance(self): # to the content-disposition header, specifically for semicolons within # quoted strings. def f(n): - start = time.time() + start = time.perf_counter() message = ( b"--1234\r\nContent-Disposition: form-data; " + b'x="' @@ -295,7 +295,7 @@ def f(n): args: dict[str, list[bytes]] = {} files: dict[str, list[HTTPFile]] = {} parse_multipart_form_data(b"1234", message, args, files) - return time.time() - start + return time.perf_counter() - start d1 = f(1_000) d2 = f(10_000) @@ -496,11 +496,11 @@ def test_invalid_header_names(self): def test_linear_performance(self): def f(n): - start = time.time() + start = time.perf_counter() headers = HTTPHeaders() for i in range(n): headers.add("X-Foo", "bar") - return time.time() - start + return time.perf_counter() - start # This runs under 50ms on my laptop as of 2025-12-09. d1 = f(10_000) diff --git a/tox.ini b/tox.ini index 88e8eb9df..db0a4b604 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,10 @@ basepython = deps = full: pycurl full: twisted - full: pycares + # Pycares 5 has some backwards-incompatible changes that we don't support. + # And since CaresResolver is deprecated, I do not expect to fix it, so just + # pin the previous version. (This should really be in requirements.{in,txt} instead) + full: pycares<5 docs: -r{toxinidir}/requirements.txt lint: -r{toxinidir}/requirements.txt