Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

test: updates tests to include new logic

Karim shoair94bc759c6ad0
diff --git a/tests/spiders/test_spider.py b/tests/spiders/test_spider.py
index 9cda3d7..c1edaed 100644
--- a/tests/spiders/test_spider.py
+++ b/tests/spiders/test_spider.py
@@ -443,13 +443,21 @@ class TestSpiderHooks:
class TestSpiderPause:
"""Test Spider pause functionality."""
- def test_pause_without_engine_raises(self):
- """Test that pause without active engine raises RuntimeError."""
+ def test_pause_without_crawldir_raises(self):
+ """Test that pause without crawldir raises RuntimeError."""
spider = ConcreteSpider()
- with pytest.raises(RuntimeError, match="no crawl engine started"):
+ 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)
+
+ with pytest.raises(RuntimeError, match="no crawl engine started"):
+ spider.pause()
+
class TestSpiderStats:
"""Test Spider stats property."""