Skip to content
Browse files

localhost666 can resolve under certain circumstances

localhost666 is resolvable if the host running the tests contains a
"search" in /etc/resolv.conf and a wildcard dns entry
exists for *
  • Loading branch information
dangra committed Feb 8, 2014
1 parent cc3eda3 commit 2ec22793cb31f84e0021a8e16c3c92608d748255
Showing with 7 additions and 3 deletions.
  1. +7 −3 scrapy/tests/
@@ -1,4 +1,6 @@
import json
import socket
import mock
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.utils.test import get_crawler, get_testlog
@@ -88,9 +90,11 @@ def test_retry_conn_failed(self):

def test_retry_dns_error(self):
spider = SimpleSpider("http://localhost666/status?n=503")
yield docrawl(spider)
with mock.patch('socket.gethostbyname',
side_effect=socket.gaierror(-5, 'No address associated with hostname')):
spider = SimpleSpider("")
yield docrawl(spider)

def test_start_requests_bug_before_yield(self):

0 comments on commit 2ec2279

Please sign in to comment.
You can’t perform that action at this time.