Move the asyncio downloader mw test to a separate class.

This commit is contained in:
Andrey Rakhmatullin 2019-12-16 19:24:44 +05:00
parent 3603644552
commit 5cf1ac0005
1 changed files with 7 additions and 0 deletions

View File

@ -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)
@mark.only_asyncio()
class MiddlewareUsingCoroAsyncio(ManagerTestCase):
settings_dict = {'ASYNCIO_ENABLED': True}
def test_asyncdef_asyncio(self):
resp = Response('http://example.com/index.html')