Skip to content

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

Move the asyncio downloader mw test to a separate class.

Andrey Rakhmatullin5cf1ac0005fa
diff --git a/tests/test_downloadermiddleware.py b/tests/test_downloadermiddleware.py
index 5b0cf1eb7..c5c4d13bd 100644
--- a/tests/test_downloadermiddleware.py
+++ b/tests/test_downloadermiddleware.py
@@ -1,6 +1,7 @@
import asyncio
from unittest import mock
+from pytest import mark
from twisted.internet import defer
from twisted.internet.defer import Deferred
from twisted.trial.unittest import TestCase
@@ -232,6 +233,12 @@ class MiddlewareUsingCoro(ManagerTestCase):
self.assertIs(results[0], resp)
self.assertFalse(download_func.called)
+
+class MiddlewareUsingCoroAsyncio(ManagerTestCase):
+
+ settings_dict = {'ASYNCIO_ENABLED': True}
+
def test_asyncdef_asyncio(self):
resp = Response('http://example.com/index.html')