@@ -55,7 +55,13 @@ def get_pem_bytes(rsa_public_key):
5555 )
5656
5757
58- class TestAsyncAsymmetricSignatureVerifier (unittest .IsolatedAsyncioTestCase ):
58+ @unittest .skipIf (
59+ not hasattr (unittest , "IsolatedAsyncioTestCase" ),
60+ "python 3.7 doesn't have IsolatedAsyncioTestCase" ,
61+ )
62+ class TestAsyncAsymmetricSignatureVerifier (
63+ getattr (unittest , "IsolatedAsyncioTestCase" , object )
64+ ):
5965 @pytest .mark .asyncio
6066 @aioresponses ()
6167 async def test_async_asymmetric_verifier_fetches_key (self , mocked ):
@@ -69,7 +75,11 @@ async def test_async_asymmetric_verifier_fetches_key(self, mocked):
6975 self .assertEqual (get_pem_bytes (key ), RSA_PUB_KEY_1_PEM )
7076
7177
72- class TestAsyncJwksFetcher (unittest .IsolatedAsyncioTestCase ):
78+ @unittest .skipIf (
79+ not hasattr (unittest , "IsolatedAsyncioTestCase" ),
80+ "python 3.7 doesn't have IsolatedAsyncioTestCase" ,
81+ )
82+ class TestAsyncJwksFetcher (getattr (unittest , "IsolatedAsyncioTestCase" , object )):
7383 @pytest .mark .asyncio
7484 @aioresponses ()
7585 @unittest .mock .patch (
@@ -225,7 +235,11 @@ async def test_async_fails_to_fetch_jwks_json_after_retrying_twice(self, mocked)
225235 self .assertEqual (mock .call_count , 2 )
226236
227237
228- class TestAsyncTokenVerifier (unittest .IsolatedAsyncioTestCase ):
238+ @unittest .skipIf (
239+ not hasattr (unittest , "IsolatedAsyncioTestCase" ),
240+ "python 3.7 doesn't have IsolatedAsyncioTestCase" ,
241+ )
242+ class TestAsyncTokenVerifier (getattr (unittest , "IsolatedAsyncioTestCase" , object )):
229243 @pytest .mark .asyncio
230244 @aioresponses ()
231245 async def test_RS256_token_signature_passes (self , mocked ):
0 commit comments