Remove quotes from item_error message

This commit is contained in:
Eugenio Lacuesta 2019-11-23 19:16:41 -03:00
parent 7a7d13b112
commit facb926542
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
2 changed files with 5 additions and 5 deletions

View File

@ -5,10 +5,10 @@ from twisted.python.failure import Failure
from scrapy.utils.request import referer_str
SCRAPEDMSG = u"Scraped from %(src)s" + os.linesep + "%(item)s"
DROPPEDMSG = u"Dropped: %(exception)s" + os.linesep + "%(item)s"
CRAWLEDMSG = u"Crawled (%(status)s) %(request)s%(request_flags)s (referer: %(referer)s)%(response_flags)s"
ITEMERRORMSG = u"'Error processing %(item)s'"
SCRAPEDMSG = "Scraped from %(src)s" + os.linesep + "%(item)s"
DROPPEDMSG = "Dropped: %(exception)s" + os.linesep + "%(item)s"
CRAWLEDMSG = "Crawled (%(status)s) %(request)s%(request_flags)s (referer: %(referer)s)%(response_flags)s"
ITEMERRORMSG = "Error processing %(item)s"
class LogFormatter(object):

View File

@ -71,7 +71,7 @@ class LogFormatterTestCase(unittest.TestCase):
response = Response("http://www.example.com")
logkws = self.formatter.item_error(item, exception, response, self.spider)
logline = logkws['msg'] % logkws['args']
self.assertEqual(logline, u"'Error processing {'key': 'value'}'")
self.assertEqual(logline, u"Error processing {'key': 'value'}")
def test_scraped(self):
item = CustomItem()