8000 Fix 3.7 tests · auth0/auth0-python@99110e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99110e9

Browse files
committed
Fix 3.7 tests
1 parent cc7e656 commit 99110e9

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

auth0/test_async/test_async_auth0.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def callback(url, **kwargs):
2222
return callback, mock
2323

2424

25-
class TestAuth0(unittest.IsolatedAsyncioTestCase):
25+
@unittest.skipIf(
26+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
27+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
28+
)
29+
class TestAuth0(getattr(unittest, "IsolatedAsyncioTestCase", object)):
2630
@pytest.mark.asyncio
2731
@aioresponses()
2832
async def test_get(self, mocked):

auth0/test_async/test_async_token_verifier.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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):

auth0/test_async/test_asyncify.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def callback(url, **kwargs):
5454
return callback, mock
5555

5656

57-
class TestAsyncify(unittest.IsolatedAsyncioTestCase):
57+
@unittest.skipIf(
58+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
59+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
60+
)
61+
class TestAsyncify(getattr(unittest, "IsolatedAsyncioTestCase", object)):
5862
@pytest.mark.asyncio
5963
@aioresponses()
6064
async def test_get(self, mocked):

0 commit comments

Comments
 (0)
0