Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Add shell test for using scrapy.Request() directly without importing scrapy

Paul Tremberthb828facff499
diff --git a/tests/test_command_shell.py b/tests/test_command_shell.py
index c532fc0d8..7bb7439d6 100644
--- a/tests/test_command_shell.py
+++ b/tests/test_command_shell.py
@@ -56,6 +56,13 @@ class ShellTest(ProcessTest, SiteTest, unittest.TestCase):
errcode, out, _ = yield self.execute(['-c', code.format(url)])
self.assertEqual(errcode, 0, out)
+ @defer.inlineCallbacks
+ def test_scrapy_import(self):
+ url = self.url('/text')
+ code = "fetch(scrapy.Request('{0}'))"
+ errcode, out, _ = yield self.execute(['-c', code.format(url)])
+ self.assertEqual(errcode, 0, out)
+
@defer.inlineCallbacks
def test_local_file(self):
filepath = join(tests_datadir, 'test_site/index.html')