Skip to content

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

Fix style issues

Adrián Chaves8f46e845190b
diff --git a/scrapy/utils/test.py b/scrapy/utils/test.py
index cf251442f..24c38283a 100644
--- a/scrapy/utils/test.py
+++ b/scrapy/utils/test.py
@@ -23,18 +23,6 @@ def skip_if_no_boto():
raise SkipTest('missing botocore library')
-def get_s3_content_and_delete(bucket, path, with_key=False):
- """ Get content from s3 key, and delete key afterwards.
- """
- import botocore.session
- session = botocore.session.get_session()
- client = session.create_client('s3')
- key = client.get_object(Bucket=bucket, Key=path)
- content = key['Body'].read()
- client.delete_object(Bucket=bucket, Key=path)
- return (content, key) if with_key else content
-
-
def get_gcs_content_and_delete(bucket, path):
from google.cloud import storage
client = storage.Client(project=os.environ.get('GCS_PROJECT_ID'))
diff --git a/tests/test_feedexport.py b/tests/test_feedexport.py
index 18f7f8458..3ed35bec5 100644
--- a/tests/test_feedexport.py
+++ b/tests/test_feedexport.py
@@ -41,7 +41,6 @@ from scrapy.extensions.feedexport import (
from scrapy.settings import Settings
from scrapy.utils.python import to_unicode
from scrapy.utils.test import (
- get_s3_content_and_delete,
get_crawler,
mock_google_cloud_storage,
skip_if_no_boto,
@@ -1577,7 +1576,7 @@ class BatchDeliveriesTest(FeedExportTestBase):
TestSpider.start_urls = [server.url('/')]
yield runner.crawl(TestSpider)
- self.assertEqual(len(CustomS3FeedStorage.stubs), len(items)+1)
+ self.assertEqual(len(CustomS3FeedStorage.stubs), len(items) + 1)
for stub in CustomS3FeedStorage.stubs[:-1]:
stub.assert_no_pending_responses()
diff --git a/tests/test_pipeline_files.py b/tests/test_pipeline_files.py
index 1b14e3b1e..e840298d9 100644
--- a/tests/test_pipeline_files.py
+++ b/tests/test_pipeline_files.py
@@ -27,7 +27,6 @@ from scrapy.utils.test import (
assert_gcs_environ,
get_ftp_content_and_delete,
get_gcs_content_and_delete,
- get_s3_content_and_delete,
skip_if_no_boto,
)