Fix dupe spider name warning string tests

This commit is contained in:
Paul Tremberth 2017-03-07 14:48:16 +01:00
parent a017f7b932
commit 978306a223
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ class DuplicateSpiderNameLoaderTest(unittest.TestCase):
spider_loader = SpiderLoader.from_settings(self.settings)
self.assertEqual(len(w), 1)
self.assertIn("several spiders with the same name (spider3)", str(w[0].message))
self.assertIn("several spiders with the same name 'spider3'", str(w[0].message))
spiders = set(spider_loader.list())
self.assertEqual(spiders, set(['spider1', 'spider2', 'spider3', 'spider4']))
@ -145,8 +145,8 @@ class DuplicateSpiderNameLoaderTest(unittest.TestCase):
self.assertEqual(len(w), 2)
msgs = sorted(str(wrn.message) for wrn in w)
self.assertIn("several spiders with the same name (spider1)", msgs[0])
self.assertIn("several spiders with the same name (spider2)", msgs[1])
self.assertIn("several spiders with the same name 'spider1'", msgs[0])
self.assertIn("several spiders with the same name 'spider2'", msgs[1])
spiders = set(spider_loader.list())
self.assertEqual(spiders, set(['spider1', 'spider2', 'spider3', 'spider4']))