Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/scrapy/scrapy
Browse files Browse the repository at this point in the history
  • Loading branch information
zaid-ismail031 committed Sep 11, 2022
2 parents c49b5aa + 3f060ae commit 3cf97e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tests/test_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from scrapy.extensions.throttle import AutoThrottle
from scrapy.extensions import telnet
from scrapy.utils.test import get_testenv
from pkg_resources import parse_version
from w3lib import __version__ as w3lib_version

from tests.mockserver import MockServer

Expand Down Expand Up @@ -378,6 +380,8 @@ def test_asyncio_enabled_reactor(self):
self.assertIn('Spider closed (finished)', log)
self.assertIn("Using reactor: twisted.internet.asyncioreactor.AsyncioSelectorReactor", log)

@mark.skipif(parse_version(w3lib_version) >= parse_version("2.0.0"),
reason='w3lib 2.0.0 and later do not allow invalid domains.')
def test_ipv6_default_name_resolver(self):
log = self.run_script('default_name_resolver.py')
self.assertIn('Spider closed (finished)', log)
Expand Down
7 changes: 4 additions & 3 deletions tests/test_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from scrapy.linkextractors import LinkExtractor
from scrapy.utils.test import get_crawler
from tests import get_testdata
from w3lib.url import safe_url_string


class SpiderTest(unittest.TestCase):
Expand Down Expand Up @@ -361,9 +362,9 @@ def process_request_upper(self, request, response):
self.assertEqual(len(output), 3)
self.assertTrue(all(map(lambda r: isinstance(r, Request), output)))
self.assertEqual([r.url for r in output],
['http://EXAMPLE.ORG/SOMEPAGE/ITEM/12.HTML',
'http://EXAMPLE.ORG/ABOUT.HTML',
'http://EXAMPLE.ORG/NOFOLLOW.HTML'])
[safe_url_string('http://EXAMPLE.ORG/SOMEPAGE/ITEM/12.HTML'),
safe_url_string('http://EXAMPLE.ORG/ABOUT.HTML'),
safe_url_string('http://EXAMPLE.ORG/NOFOLLOW.HTML')])

def test_process_request_instance_method_with_response(self):

Expand Down

0 comments on commit 3cf97e4

Please sign in to comment.