Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fix flaky tests involving feed export batches (#5898)

tstauderef61fb5698c9
diff --git a/tests/test_feedexport.py b/tests/test_feedexport.py
index 3124d9d67..83de0e77e 100644
--- a/tests/test_feedexport.py
+++ b/tests/test_feedexport.py
@@ -2542,7 +2542,7 @@ class BatchDeliveriesTest(FeedExportTestBase):
def test_batch_path_differ(self):
"""
Test that the name of all batch files differ from each other.
- So %(batch_time)s replaced with the current date.
+ So %(batch_id)d replaced with the current id.
"""
items = [
self.MyItem({"foo": "bar1", "egg": "spam1"}),
@@ -2552,7 +2552,7 @@ class BatchDeliveriesTest(FeedExportTestBase):
settings = {
"FEEDS": {
self._random_temp_filename()
- / "%(batch_time)s": {
+ / "%(batch_id)d": {
"format": "json",
},
},
@@ -2615,7 +2615,7 @@ class BatchDeliveriesTest(FeedExportTestBase):
return super().open(*args, **kwargs)
key = "export.csv"
- uri = f"s3://{bucket}/{key}/%(batch_time)s.json"
+ uri = f"s3://{bucket}/{key}/%(batch_id)d.json"
batch_item_count = 1
settings = {
"AWS_ACCESS_KEY_ID": "access_key",