Move private key initialization out of pytest.raises block
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 545ca6c..37633d6 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -468,8 +468,10 @@
)
)
+ private_key_alt = RSA_KEY_512_ALT.private_key(backend)
+
with pytest.raises(ValueError):
- RSA_KEY_512_ALT.private_key(backend).decrypt(
+ private_key_alt.decrypt(
ciphertext,
padding.OAEP(
mgf=padding.MGF1(algorithm=hashes.SHA1()),