Scrapy, a fast high-level web crawling & scraping framework for Python.
tests: fixed httpcache testcase.
Rolando Espinoza La fuente93eb5b32ddd8
diff --git a/scrapy/tests/test_downloadermiddleware_httpcache.py b/scrapy/tests/test_downloadermiddleware_httpcache.pyindex af54383f6..ceca8cc80 100644--- a/scrapy/tests/test_downloadermiddleware_httpcache.py+++ b/scrapy/tests/test_downloadermiddleware_httpcache.py@@ -3,6 +3,7 @@ import unittest, tempfile, shutil, timefrom scrapy.http import Response, HtmlResponse, Requestfrom scrapy.spider import BaseSpiderfrom scrapy.contrib.downloadermiddleware.httpcache import FilesystemCacheStorage, HttpCacheMiddleware+from scrapy.stats import statsfrom scrapy.settings import Settingsfrom scrapy.exceptions import IgnoreRequest@@ -16,8 +17,10 @@ class HttpCacheMiddlewareTest(unittest.TestCase):self.tmpdir = tempfile.mkdtemp()self.request = Request('http://www.example.com', headers={'User-Agent': 'test'})self.response = Response('http://www.example.com', headers={'Content-Type': 'text/html'}, body='test body', status=202)+ stats.open_spider(self.spider)def tearDown(self):+ stats.close_spider(self.spider, '')shutil.rmtree(self.tmpdir)def _get_settings(self, **new_settings):