mirror of https://github.com/scrapy/scrapy.git
Update test expectations
This commit is contained in:
parent
dbdfb1854d
commit
0a4223ffeb
|
|
@ -1,7 +1,7 @@
|
|||
import gzip
|
||||
import warnings
|
||||
from io import BytesIO
|
||||
from logging import ERROR, WARNING
|
||||
from logging import WARNING
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from unittest import mock
|
||||
|
|
@ -447,23 +447,6 @@ class TestCrawlSpider(TestSpider):
|
|||
assert hasattr(spider, "_follow_links")
|
||||
assert not spider._follow_links
|
||||
|
||||
@inlineCallbacks
|
||||
def test_start_url(self):
|
||||
class TestSpider(self.spider_class):
|
||||
name = "test"
|
||||
start_url = "https://www.example.com"
|
||||
|
||||
crawler = get_crawler(TestSpider)
|
||||
with LogCapture("scrapy.core.engine", propagate=False, level=ERROR) as log:
|
||||
yield crawler.crawl()
|
||||
log.check(
|
||||
(
|
||||
"scrapy.core.engine",
|
||||
"ERROR",
|
||||
"Error while reading seeds",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class TestSitemapSpider(TestSpider):
|
||||
spider_class = SitemapSpider
|
||||
|
|
|
|||
|
|
@ -220,3 +220,17 @@ class MainTestCase(TestCase):
|
|||
await self._test_yield_seeds(yield_seeds, [ITEM_A])
|
||||
|
||||
assert "in yield_seeds\n raise RuntimeError" in str(log), log
|
||||
|
||||
@deferred_f_from_coro_f
|
||||
async def test_start_url(self):
|
||||
class TestSpider(Spider):
|
||||
name = "test"
|
||||
start_url = "https://toscrape.com"
|
||||
|
||||
with LogCapture() as log:
|
||||
await self._test_spider(TestSpider, [])
|
||||
|
||||
assert "Error while reading seeds" in str(log), log
|
||||
assert "found 'start_url' attribute instead, did you miss an 's'?" in str(
|
||||
log
|
||||
), log
|
||||
|
|
|
|||
Loading…
Reference in New Issue