test: update tests accordingly
This commit is contained in:
@@ -443,20 +443,12 @@ class TestSpiderHooks:
|
||||
class TestSpiderPause:
|
||||
"""Test Spider pause functionality."""
|
||||
|
||||
def test_pause_without_crawldir_raises(self):
|
||||
"""Test that pause without crawldir raises RuntimeError."""
|
||||
spider = ConcreteSpider()
|
||||
|
||||
with pytest.raises(RuntimeError, match="Cannot pause without crawldir"):
|
||||
spider.pause()
|
||||
|
||||
def test_pause_without_engine_raises(self):
|
||||
"""Test that pause without active engine raises RuntimeError."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
spider = ConcreteSpider(crawldir=tmpdir)
|
||||
spider = ConcreteSpider()
|
||||
|
||||
with pytest.raises(RuntimeError, match="no crawl engine started"):
|
||||
spider.pause()
|
||||
with pytest.raises(RuntimeError, match="No active crawl to stop"):
|
||||
spider.pause()
|
||||
|
||||
|
||||
class TestSpiderStats:
|
||||
|
||||
Reference in New Issue
Block a user