From b4ff1182c4e6587369df0e96d072b06d40a8dd0c Mon Sep 17 00:00:00 2001 From: Christopher Grebs Date: Sat, 5 Sep 2015 00:25:25 +0200 Subject: Move private key initialization out of pytest.raises block --- tests/hazmat/backends/test_openssl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/hazmat/backends') diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 545ca6c2..37633d6c 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -468,8 +468,10 @@ class TestOpenSSLRSA(object): ) ) + 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()), -- cgit v1.2.3