Fix SpiderLoaderTest on Python 3.10.

This commit is contained in:
Andrey Rakhmatullin 2021-08-11 10:39:23 +05:00
parent 93bf1ae7e3
commit 983b89ad4f
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,11 @@ class SpiderLoaderTest(unittest.TestCase):
settings = Settings({'SPIDER_MODULES': [module],
'SPIDER_LOADER_WARN_ONLY': True})
spider_loader = SpiderLoader.from_settings(settings)
if str(w[0].message).startswith("_SixMetaPathImporter"):
# needed on 3.10 because of https://github.com/benjaminp/six/issues/349,
# at least until all six versions we can import (including botocore.vendored.six)
# are updated to 1.16.0+
w.pop(0)
self.assertIn("Could not load spiders from module", str(w[0].message))
spiders = spider_loader.list()