Skip to content

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

skip image pipeline tests if Image module is not available

Pablo Hoffman9c005f8e7580
diff --git a/scrapy/trunk/scrapy/tests/test_pipeline_images.py b/scrapy/trunk/scrapy/tests/test_pipeline_images.py
index b2abb1bd7..f45a9fd34 100644
--- a/scrapy/trunk/scrapy/tests/test_pipeline_images.py
+++ b/scrapy/trunk/scrapy/tests/test_pipeline_images.py
@@ -1,8 +1,13 @@
-import unittest
-from scrapy.contrib.pipeline.images import BaseImagesPipeline
+from twisted.trial import unittest
class ImagesPipelineTestCase(unittest.TestCase):
def setUp(self):
+ try:
+ import Image
+ except ImportError, e:
+ raise unittest.SkipTest(e)
+
+ from scrapy.contrib.pipeline.images import BaseImagesPipeline
self.pipeline = BaseImagesPipeline()
def tearDown(self):