Fix FileFeedStoragePreFeedOptionsTest fails in CI/CD pipeline (#5198)

This commit is contained in:
Mannan2812 2021-08-06 00:53:11 +05:30 committed by GitHub
parent 4d1ecc31c9
commit 94baa4b272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -1932,14 +1932,15 @@ class FileFeedStoragePreFeedOptionsTest(unittest.TestCase):
maxDiff = None
def test_init(self):
settings_dict = {
'FEED_URI': 'file:///tmp/foobar',
'FEED_STORAGES': {
'file': FileFeedStorageWithoutFeedOptions
},
}
crawler = get_crawler(settings_dict=settings_dict)
feed_exporter = FeedExporter.from_crawler(crawler)
with tempfile.NamedTemporaryFile() as temp:
settings_dict = {
'FEED_URI': f'file:///{temp.name}',
'FEED_STORAGES': {
'file': FileFeedStorageWithoutFeedOptions
},
}
crawler = get_crawler(settings_dict=settings_dict)
feed_exporter = FeedExporter.from_crawler(crawler)
spider = scrapy.Spider("default")
with warnings.catch_warnings(record=True) as w:
feed_exporter.open_spider(spider)