Skip new test if python version less than 3.8

This commit is contained in:
Samuel Bartlett 2023-03-31 14:38:06 +00:00
parent c9a5934494
commit 608b7de582
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import pickle
import re
import unittest
import sys
from scrapy.http import HtmlResponse, XmlResponse
from scrapy.link import Link
@ -816,6 +817,10 @@ class LxmlLinkExtractorTestCase(Base.LinkExtractorTestCase):
def test_restrict_xpaths_with_html_entities(self):
super().test_restrict_xpaths_with_html_entities()
@unittest.skipIf(
sys.version_info < (3, 8),
reason="Urllib3 is less strict in versions for python 3.7 so does not cause spider to crash",
)
def test_skip_bad_links(self):
html = b"""
<a href="http://Some wierd html : http://example.com/like_this">Why would you do this?</a>