Scrapy, a fast high-level web crawling & scraping framework for Python.
test ip concurrency incompatibility with DAPQ
Vostretsov Nikita987c2ae4a964
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.pyindex 9bdc82b30..17b706bd7 100644--- a/tests/test_scheduler.py+++ b/tests/test_scheduler.py@@ -301,3 +301,20 @@ class TestIntegrationWithDownloaderAwareOnDisk(TestCase):yield self.crawler.crawl(slots)self.assertEqual(self.crawler.stats.get_value('downloader/response_count'),len(slots))+++class TestIncompatibility(unittest.TestCase):++ def _incompatible(self):+ settings = dict(+ SCHEDULER_PRIORITY_QUEUE='scrapy.pqueues.DownloaderAwarePriorityQueue',+ CONCURRENT_REQUESTS_PER_IP=1+ )+ crawler = Crawler(Spider, settings)+ scheduler = Scheduler.from_crawler(crawler)+ spider = Spider(name='spider')+ scheduler.open(spider)++ def test_incompatibility(self):+ with self.assertRaises(ValueError):+ self._incompatible()