Scrapy, a fast high-level web crawling & scraping framework for Python.
Silence the readBody warning.
Andrey Rakhmatullin0d2d2892badb
diff --git a/tests/test_core_downloader.py b/tests/test_core_downloader.pyindex e67337fc7..dffba303f 100644--- a/tests/test_core_downloader.py+++ b/tests/test_core_downloader.py@@ -9,7 +9,7 @@ from typing import Anyimport OpenSSL.SSLimport pytestfrom twisted.internet import reactor-from twisted.internet.defer import inlineCallbacks+from twisted.internet.defer import Deferred, inlineCallbacksfrom twisted.protocols.policies import WrappingFactoryfrom twisted.trial import unittestfrom twisted.web import server, static@@ -79,7 +79,15 @@ class ContextFactoryBaseTestCase(unittest.TestCase):response: TxResponse = await maybe_deferred_to_future(agent.request(b"GET", url.encode(), bodyProducer=body_producer))- return await maybe_deferred_to_future(readBody(response)) # type: ignore[arg-type]+ with warnings.catch_warnings():+ # https://github.com/twisted/twisted/issues/8227+ warnings.filterwarnings(+ "ignore",+ category=DeprecationWarning,+ message=r".*does not have an abortConnection method",+ )+ d: Deferred[bytes] = readBody(response) # type: ignore[arg-type]+ return await maybe_deferred_to_future(d)class ContextFactoryTestCase(ContextFactoryBaseTestCase):