Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

report warnings

Vostretsov Nikita31b8a6b33aed
diff --git a/tests/test_crawler.py b/tests/test_crawler.py
index 268948a70..d9ec9ee8d 100644
--- a/tests/test_crawler.py
+++ b/tests/test_crawler.py
@@ -1,5 +1,4 @@
import logging
-import tempfile
import warnings
from twisted.internet import defer
@@ -37,7 +36,11 @@ class CrawlerTestCase(BaseCrawlerTest):
self.assertIsInstance(spiders, sl_cls)
self.crawler.spiders
- self.assertEqual(len(w), 1, "Warn deprecated access only once")
+ is_one_warning = len(w) == 1
+ if not is_one_warning:
+ for warning in w:
+ print(warning)
+ self.assertTrue(is_one_warning, "Warn deprecated access only once")
def test_populate_spidercls_settings(self):
spider_settings = {'TEST1': 'spider', 'TEST2': 'spider'}