diff options
Diffstat (limited to 'tests/test_algorithms.py')
-rw-r--r-- | tests/test_algorithms.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/test_algorithms.py b/tests/test_algorithms.py index 02c3241..3009833 100644 --- a/tests/test_algorithms.py +++ b/tests/test_algorithms.py @@ -3,14 +3,14 @@ import json import pytest -from jwt.algorithms import Algorithm, HMACAlgorithm, NoneAlgorithm +from jwt.algorithms import Algorithm, HMACAlgorithm, NoneAlgorithm, has_crypto from jwt.exceptions import InvalidKeyError from jwt.utils import base64url_decode -from .keys import load_hmac_key +from .keys import load_ec_pub_key_p_521, load_hmac_key, load_rsa_pub_key from .utils import crypto_required, key_path -try: +if has_crypto: from jwt.algorithms import ( ECAlgorithm, Ed25519Algorithm, @@ -18,10 +18,6 @@ try: RSAPSSAlgorithm, ) - from .keys import load_ec_pub_key_p_521, load_rsa_pub_key -except ImportError: - pass - class TestAlgorithms: def test_algorithm_should_throw_exception_if_prepare_key_not_impl(self): |