Skip to content

Commit 8384f13

Browse files
committed
Skip async tests for 3.7
1 parent 010ec79 commit 8384f13

3 files changed

Lines changed: 29 additions & 7 deletions

File tree

auth0/v3/test_async/test_async_auth0.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import platform
44
import re
55
import sys
6+
import unittest
67
from tempfile import TemporaryFile
7-
from unittest import IsolatedAsyncioTestCase
88

99
import aiohttp
1010
from aioresponses import CallbackResult, aioresponses
@@ -27,7 +27,11 @@ def callback(url, **kwargs):
2727
return callback, mock
2828

2929

30-
class TestAsyncify(IsolatedAsyncioTestCase):
30+
@unittest.skipIf(
31+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
32+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
33+
)
34+
class TestAuth0(getattr(unittest, "IsolatedAsyncioTestCase", object)):
3135
@aioresponses()
3236
async def test_get(self, mocked):
3337
callback, mock = get_callback()

auth0/v3/test_async/test_async_token_verifier.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ def get_pem_bytes(rsa_public_key):
5454
)
5555

5656

57-
class TestAsyncAsymmetricSignatureVerifier(unittest.IsolatedAsyncioTestCase):
57+
@unittest.skipIf(
58+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
59+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
60+
)
61+
class TestAsyncAsymmetricSignatureVerifier(
62+
getattr(unittest, "IsolatedAsyncioTestCase", object)
63+
):
5864
@aioresponses()
5965
async def test_async_asymmetric_verifier_fetches_key(self, mocked):
6066
callback, mock = get_callback(200, JWKS_RESPONSE_SINGLE_KEY)
@@ -67,7 +73,11 @@ async def test_async_asymmetric_verifier_fetches_key(self, mocked):
6773
self.assertEqual(get_pem_bytes(key), RSA_PUB_KEY_1_PEM)
6874

6975

70-
class TestAsyncJwksFetcher(unittest.IsolatedAsyncioTestCase):
76+
@unittest.skipIf(
77+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
78+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
79+
)
80+
class TestAsyncJwksFetcher(getattr(unittest, "IsolatedAsyncioTestCase", object)):
7181
@aioresponses()
7282
async def test_async_get_jwks_json_twice_on_cache_expired(self, mocked):
7383
fetcher = AsyncJwksFetcher(JWKS_URI, cache_ttl=1)
@@ -213,7 +223,11 @@ async def test_async_fails_to_fetch_jwks_json_after_retrying_twice(self, mocked)
213223
self.assertEqual(mock.call_count, 2)
214224

215225

216-
class TestAsyncTokenVerifier(unittest.IsolatedAsyncioTestCase):
226+
@unittest.skipIf(
227+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
228+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
229+
)
230+
class TestAsyncTokenVerifier(getattr(unittest, "IsolatedAsyncioTestCase", object)):
217231
@aioresponses()
218232
async def test_RS256_token_signature_passes(self, mocked):
219233
callback, mock = get_callback(200, {"keys": [PUBLIC_KEY]})

auth0/v3/test_async/test_asyncify.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import platform
44
import re
55
import sys
6+
import unittest
67
from tempfile import TemporaryFile
7-
from unittest import IsolatedAsyncioTestCase
88

99
import aiohttp
1010
from aioresponses import CallbackResult, aioresponses
@@ -50,7 +50,11 @@ def callback(url, **kwargs):
5050
return callback, mock
5151

5252

53-
class TestAsyncify(IsolatedAsyncioTestCase):
53+
@unittest.skipIf(
54+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
55+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
56+
)
57+
class TestAsyncify(getattr(unittest, "IsolatedAsyncioTestCase", object)):
5458
@aioresponses()
5559
async def test_get(self, mocked):
5660
callback, mock = get_callback()

0 commit comments

Comments
 (0)