Scrapy, a fast high-level web crawling & scraping framework for Python.
Merge branch 'master' of github.com:StasDeep/scrapy into feature/issue-3364
Stas Glubokiy8bc536d88b28
diff --cc tests/test_contracts.pyindex 078ef6e0d,b07cbee1e..9c80d48bd--- a/tests/test_contracts.py+++ b/tests/test_contracts.py@@@ -230,9 -188,17 +232,24 @@@ class ContractsManagerTest(unittest.Tesrequest.callback(response)self.should_fail()+ def test_custom_contracts(self):+ self.conman.from_spider(CustomContractSuccessSpider(), self.results)+ self.should_succeed()++ self.conman.from_spider(CustomContractFailSpider(), self.results)+ self.should_error()+++ def test_errback(self):+ spider = TestSpider()+ response = ResponseMock()++ try:+ raise HttpError(response, 'Ignoring non-200 response')+ except HttpError:+ failure_mock = failure.Failure()++ request = self.conman.from_method(spider.returns_request, self.results)+ request.errback(failure_mock)++ self.assertFalse(self.results.failures)+ self.assertTrue(self.results.errors)