@@ -55,7 +55,13 @@ def get_pem_bytes(rsa_public_key):
55
55
)
56
56
57
57
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
+ ):
59
65
@pytest .mark .asyncio
60
66
@aioresponses ()
61
67
async def test_async_asymmetric_verifier_fetches_key (self , mocked ):
@@ -69,7 +75,11 @@ async def test_async_asymmetric_verifier_fetches_key(self, mocked):
69
75
self .assertEqual (get_pem_bytes (key ), RSA_PUB_KEY_1_PEM )
70
76
71
77
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 )):
73
83
@pytest .mark .asyncio
74
84
@aioresponses ()
75
85
@unittest .mock .patch (
@@ -225,7 +235,11 @@ async def test_async_fails_to_fetch_jwks_json_after_retrying_twice(self, mocked)
225
235
self .assertEqual (mock .call_count , 2 )
226
236
227
237
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 )):
229
243
@pytest .mark .asyncio
230
244
@aioresponses ()
231
245
async def test_RS256_token_signature_passes (self , mocked ):
0 commit comments