Scrapy, a fast high-level web crawling & scraping framework for Python.
chore(tests): Remove validations for unsupported modules versions
Laerte Pereira6770d1ec6201
diff --git a/tests/test_downloadermiddleware.py b/tests/test_downloadermiddleware.pyindex b538a0ed3..38be915f2 100644--- a/tests/test_downloadermiddleware.py+++ b/tests/test_downloadermiddleware.py@@ -1,13 +1,11 @@import asyncio-from unittest import mock, SkipTest+from unittest import mockfrom pytest import mark-from twisted import version as twisted_versionfrom twisted.internet import deferfrom twisted.internet.defer import Deferredfrom twisted.trial.unittest import TestCasefrom twisted.python.failure import Failure-from twisted.python.versions import Versionfrom scrapy.http import Request, Responsefrom scrapy.spiders import Spider@@ -218,16 +216,6 @@ class MiddlewareUsingCoro(ManagerTestCase):"""Middlewares using asyncio coroutines should work"""def test_asyncdef(self):- if (- self.reactor_pytest == 'asyncio'- and twisted_version < Version('twisted', 18, 4, 0)- ):- raise SkipTest(- 'Due to https://twistedmatrix.com/trac/ticket/9390, this test '- 'hangs when using AsyncIO and Twisted versions lower than '- '18.4.0'- )-resp = Response('http://example.com/index.html')class CoroMiddleware:@@ -248,12 +236,6 @@ class MiddlewareUsingCoro(ManagerTestCase):@mark.only_asyncio()def test_asyncdef_asyncio(self):- if twisted_version < Version('twisted', 18, 4, 0):- raise SkipTest(- 'Due to https://twistedmatrix.com/trac/ticket/9390, this test '- 'hangs when using Twisted versions lower than 18.4.0'- )-resp = Response('http://example.com/index.html')class CoroMiddleware:diff --git a/tests/test_utils_signal.py b/tests/test_utils_signal.pyindex ad7394232..a36e7bc97 100644--- a/tests/test_utils_signal.py+++ b/tests/test_utils_signal.py@@ -1,13 +1,10 @@import asyncio-from unittest import SkipTestfrom pydispatch import dispatcherfrom pytest import markfrom testfixtures import LogCapture-from twisted import version as twisted_versionfrom twisted.internet import defer, reactorfrom twisted.python.failure import Failure-from twisted.python.versions import Versionfrom twisted.trial import unittestfrom scrapy.utils.signal import send_catch_log, send_catch_log_deferred@@ -81,16 +78,6 @@ class SendCatchLogDeferredAsyncDefTest(SendCatchLogDeferredTest):return "OK"def test_send_catch_log(self):- if (- self.reactor_pytest == 'asyncio'- and twisted_version < Version('twisted', 18, 4, 0)- ):- raise SkipTest(- 'Due to https://twistedmatrix.com/trac/ticket/9390, this test '- 'fails due to a timeout when using AsyncIO and Twisted '- 'versions lower than 18.4.0'- )-return super().test_send_catch_log()@@ -104,13 +91,6 @@ class SendCatchLogDeferredAsyncioTest(SendCatchLogDeferredTest):return await get_from_asyncio_queue("OK")def test_send_catch_log(self):- if twisted_version < Version('twisted', 18, 4, 0):- raise SkipTest(- 'Due to https://twistedmatrix.com/trac/ticket/9390, this test '- 'fails due to a timeout when using Twisted versions lower '- 'than 18.4.0'- )-return super().test_send_catch_log()diff --git a/tests/test_webclient.py b/tests/test_webclient.pyindex a6d55cb38..0d5827339 100644--- a/tests/test_webclient.py+++ b/tests/test_webclient.py@@ -4,10 +4,7 @@ Tests borrowed from the twisted.web.client tests."""import osimport shutil-import sys-from pkg_resources import parse_version-import cryptographyimport OpenSSL.SSLfrom twisted.trial import unittestfrom twisted.web import server, static, util, resource@@ -417,8 +414,6 @@ class WebClientCustomCiphersSSLTestCase(WebClientSSLTestCase):).addCallback(self.assertEqual, to_bytes(s))def testPayloadDisabledCipher(self):- if sys.implementation.name == "pypy" and parse_version(cryptography.__version__) <= parse_version("2.3.1"):- self.skipTest("This test expects a failure, but the code does work in PyPy with cryptography<=2.3.1")s = "0123456789" * 10settings = Settings({'DOWNLOADER_CLIENT_TLS_CIPHERS': 'ECDHE-RSA-AES256-GCM-SHA384'})client_context_factory = create_instance(ScrapyClientContextFactory, settings=settings, crawler=None)