14
0
forked from pool/python-Scrapy
Files
python-Scrapy/zope-exception-test_crawler.patch
Steve Kowalik 5577430fb1 - Update to 2.0.1:
* Python 2 support has been removed
  * Partial coroutine syntax support and experimental asyncio support
  * New Response.follow_all method
  * FTP support for media pipelines
  * New Response.certificate attribute
  * IPv6 support through DNS_RESOLVER
  * Response.follow_all now supports an empty URL iterable as input
  * Removed top-level reactor imports to prevent errors about the wrong
    Twisted reactor being installed when setting a different Twisted
    reactor using TWISTED_REACTOR
- Add zope-exception-test_crawler.patch, rewriting one testcase to pass
  with our version of Zope.
- Update BuildRequires based on test requirements.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Scrapy?expand=0&rev=12
2020-04-02 03:41:29 +00:00

29 lines
1.2 KiB
Diff

Index: Scrapy-2.0.1/tests/test_crawler.py
===================================================================
--- Scrapy-2.0.1.orig/tests/test_crawler.py
+++ Scrapy-2.0.1/tests/test_crawler.py
@@ -20,6 +20,8 @@ from scrapy.extensions.throttle import A
from scrapy.extensions import telnet
from scrapy.utils.test import get_testenv
+from zope.interface.exceptions import MultipleInvalid
+
class BaseCrawlerTest(unittest.TestCase):
@@ -157,11 +159,9 @@ class CrawlerRunnerTestCase(BaseCrawlerT
settings = Settings({
'SPIDER_LOADER_CLASS': 'tests.test_crawler.SpiderLoaderWithWrongInterface'
})
- with warnings.catch_warnings(record=True) as w:
- self.assertRaises(AttributeError, CrawlerRunner, settings)
- self.assertEqual(len(w), 1)
- self.assertIn("SPIDER_LOADER_CLASS", str(w[0].message))
- self.assertIn("scrapy.interfaces.ISpiderLoader", str(w[0].message))
+ msg = "SpiderLoaderWithWrongInterface.*scrapy.interfaces.ISpiderLoader"
+ with self.assertRaisesRegex(MultipleInvalid, msg):
+ CrawlerRunner(settings)
def test_crawler_runner_accepts_dict(self):
runner = CrawlerRunner({'foo': 'bar'})