mirror of https://github.com/scrapy/scrapy.git
Add a test.
This commit is contained in:
parent
d3b5c9be97
commit
b39d2d4353
|
|
@ -6,6 +6,7 @@ import sys
|
|||
import warnings
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from packaging.version import parse as parse_version
|
||||
from pytest import mark, raises
|
||||
from twisted.internet import defer
|
||||
|
|
@ -67,6 +68,16 @@ class CrawlerTestCase(BaseCrawlerTest):
|
|||
with raises(ValueError):
|
||||
Crawler(DefaultSpider())
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_crawler_crawl_twice_deprecated(self):
|
||||
crawler = Crawler(NoRequestsSpider)
|
||||
yield crawler.crawl()
|
||||
with pytest.warns(
|
||||
ScrapyDeprecationWarning,
|
||||
match=r"Running Crawler.crawl\(\) more than once is deprecated",
|
||||
):
|
||||
yield crawler.crawl()
|
||||
|
||||
|
||||
class SpiderSettingsTestCase(unittest.TestCase):
|
||||
def test_spider_custom_settings(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue