Clean up Twisted version check

This commit is contained in:
Adrián Chaves 2020-11-06 12:34:29 +01:00
parent 6eaf0c5cc9
commit ea851b910e
1 changed files with 2 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import asyncio
from unittest import mock, SkipTest
from pytest import mark
from twisted import version as twisted_version
from twisted.internet import defer
from twisted.internet.defer import Deferred
from twisted.trial.unittest import TestCase
@ -217,10 +218,9 @@ class MiddlewareUsingCoro(ManagerTestCase):
"""Middlewares using asyncio coroutines should work"""
def test_asyncdef(self):
import twisted
if (
self.reactor_pytest == 'asyncio'
and twisted.version < Version('twisted', 18, 4, 0)
and twisted_version < Version('twisted', 18, 4, 0)
):
raise SkipTest(
'Due to https://twistedmatrix.com/trac/ticket/9390, this test '
@ -228,8 +228,6 @@ class MiddlewareUsingCoro(ManagerTestCase):
'18.4.0'
)
from twisted.python.versions import Version
resp = Response('http://example.com/index.html')
class CoroMiddleware: