@@ -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 @unittest .mock .patch (
7383 "auth0.v3.authentication.token_verifier.time.time" , return_value = 0
@@ -218,7 +228,11 @@ async def test_async_fails_to_fetch_jwks_json_after_retrying_twice(self, mocked)
218228 self .assertEqual (mock .call_count , 2 )
219229
220230
221- class TestAsyncTokenVerifier (unittest .IsolatedAsyncioTestCase ):
231+ @unittest .skipIf (
232+ not hasattr (unittest , "IsolatedAsyncioTestCase" ),
233+ "python 3.7 doesn't have IsolatedAsyncioTestCase" ,
234+ )
235+ class TestAsyncTokenVerifier (getattr (unittest , "IsolatedAsyncioTestCase" , object )):
222236 @aioresponses ()
223237 async def test_RS256_token_signature_passes (self , mocked ):
224238 callback , mock = get_callback (200 , {"keys" : [PUBLIC_KEY ]})
0 commit comments