@@ -3874,7 +3874,7 @@ def test_verify_with_revoked(self):
38743874 store_ctx = X509StoreContext (store , self .intermediate_server_cert )
38753875 with pytest .raises (X509StoreContextError ) as err :
38763876 store_ctx .verify_certificate ()
3877- assert err .value . args [ 0 ][ 2 ] == "certificate revoked"
3877+ assert str ( err .value ) == "certificate revoked"
38783878
38793879 def test_verify_with_missing_crl (self ):
38803880 """
@@ -3894,7 +3894,7 @@ def test_verify_with_missing_crl(self):
38943894 store_ctx = X509StoreContext (store , self .intermediate_server_cert )
38953895 with pytest .raises (X509StoreContextError ) as err :
38963896 store_ctx .verify_certificate ()
3897- assert err .value . args [ 0 ][ 2 ] == "unable to get certificate CRL"
3897+ assert str ( err .value ) == "unable to get certificate CRL"
38983898 assert err .value .certificate .get_subject ().CN == "intermediate-service"
38993899
39003900 def test_convert_from_cryptography (self ):
@@ -4106,7 +4106,7 @@ def test_untrusted_self_signed(self):
41064106 store_ctx .verify_certificate ()
41074107
41084108 # OpenSSL 1.1.x and 3.0.x have different error messages
4109- assert exc .value . args [ 0 ][ 2 ] in [
4109+ assert str ( exc .value ) in [
41104110 "self signed certificate" ,
41114111 "self-signed certificate" ,
41124112 ]
@@ -4124,7 +4124,7 @@ def test_invalid_chain_no_root(self):
41244124 with pytest .raises (X509StoreContextError ) as exc :
41254125 store_ctx .verify_certificate ()
41264126
4127- assert exc .value . args [ 0 ][ 2 ] == "unable to get issuer certificate"
4127+ assert str ( exc .value ) == "unable to get issuer certificate"
41284128 assert exc .value .certificate .get_subject ().CN == "intermediate"
41294129
41304130 def test_invalid_chain_no_intermediate (self ):
@@ -4139,7 +4139,7 @@ def test_invalid_chain_no_intermediate(self):
41394139 with pytest .raises (X509StoreContextError ) as exc :
41404140 store_ctx .verify_certificate ()
41414141
4142- assert exc .value . args [ 0 ][ 2 ] == "unable to get local issuer certificate"
4142+ assert str ( exc .value ) == "unable to get local issuer certificate"
41434143 assert exc .value .certificate .get_subject ().CN == "intermediate-service"
41444144
41454145 def test_modification_pre_verify (self ):
@@ -4157,7 +4157,7 @@ def test_modification_pre_verify(self):
41574157 with pytest .raises (X509StoreContextError ) as exc :
41584158 store_ctx .verify_certificate ()
41594159
4160- assert exc .value . args [ 0 ][ 2 ] == "unable to get issuer certificate"
4160+ assert str ( exc .value ) == "unable to get issuer certificate"
41614161 assert exc .value .certificate .get_subject ().CN == "intermediate"
41624162
41634163 store_ctx .set_store (store_good )
@@ -4182,7 +4182,7 @@ def test_verify_with_time(self):
41824182 with pytest .raises (X509StoreContextError ) as exc :
41834183 store_ctx .verify_certificate ()
41844184
4185- assert exc .value . args [ 0 ][ 2 ] == "certificate has expired"
4185+ assert str ( exc .value ) == "certificate has expired"
41864186
41874187 def test_get_verified_chain (self ):
41884188 """
@@ -4216,7 +4216,7 @@ def test_get_verified_chain_invalid_chain_no_root(self):
42164216 with pytest .raises (X509StoreContextError ) as exc :
42174217 store_ctx .get_verified_chain ()
42184218
4219- assert exc .value . args [ 0 ][ 2 ] == "unable to get issuer certificate"
4219+ assert str ( exc .value ) == "unable to get issuer certificate"
42204220 assert exc .value .certificate .get_subject ().CN == "intermediate"
42214221
42224222 @pytest .fixture
@@ -4281,7 +4281,7 @@ def test_verify_failure_with_empty_ca_directory(self, tmpdir):
42814281 with pytest .raises (X509StoreContextError ) as exc :
42824282 store_ctx .verify_certificate ()
42834283
4284- assert exc .value . args [ 0 ][ 2 ] == "unable to get local issuer certificate"
4284+ assert str ( exc .value ) == "unable to get local issuer certificate"
42854285
42864286
42874287class TestSignVerify :
0 commit comments