Skip to content

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

Fix flake8 issues.

Andrey Rakhmatullinb21c16099ed0
diff --git a/tests/test_spidermiddleware.py b/tests/test_spidermiddleware.py
index ed0912b82..edde6f682 100644
--- a/tests/test_spidermiddleware.py
+++ b/tests/test_spidermiddleware.py
@@ -305,8 +305,8 @@ class ProcessSpiderOutputInvalidResult(BaseAsyncSpiderMiddlewareTestCase):
with self.assertRaisesRegex(
_InvalidOutput,
(
- "\.process_spider_output must return an iterable, got <class "
- "'NoneType'>"
+ r"\.process_spider_output must return an iterable, got <class "
+ r"'NoneType'>"
),
):
yield self._get_middleware_result(
@@ -317,7 +317,7 @@ class ProcessSpiderOutputInvalidResult(BaseAsyncSpiderMiddlewareTestCase):
def test_coroutine(self):
with self.assertRaisesRegex(
_InvalidOutput,
- "\.process_spider_output must be an asynchronous generator",
+ r"\.process_spider_output must be an asynchronous generator",
):
yield self._get_middleware_result(
ProcessSpiderOutputCoroutineMiddleware,
diff --git a/tests/test_utils_python.py b/tests/test_utils_python.py
index 00b06b839..b1a8fdc04 100644
--- a/tests/test_utils_python.py
+++ b/tests/test_utils_python.py
@@ -2,8 +2,6 @@ import functools
import gc
import operator
import platform
-import unittest
-from datetime import datetime
from itertools import count
from warnings import catch_warnings, filterwarnings