Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 7e5cafd

Browse files
committed
support running without rsa
1 parent 23c8865 commit 7e5cafd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/crypt/test__cryptography_rsa.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import json
1616
import os
1717
import pickle
18-
import warnings
1918

2019
from cryptography.hazmat.primitives.asymmetric import rsa
2120
import pytest # type: ignore
@@ -24,6 +23,10 @@
2423
from google.auth.crypt import _cryptography_rsa
2524
from google.auth.crypt import base
2625

26+
try:
27+
import rsa
28+
except ImportError:
29+
rsa = None
2730

2831
DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data")
2932

@@ -184,7 +187,6 @@ class TestRSATransparency(object):
184187
"""
185188
@classmethod
186189
def setup_class(cls):
187-
import rsa
188190
(cls.pub_key_rsa, cls.priv_key_rsa) = rsa.newkeys(512)
189191
cls.message = b"test message"
190192

0 commit comments

Comments
 (0)