Skip to content

Commit

Permalink
Fix failing test when running offline (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
facutuesca committed Oct 24, 2023
1 parent bbcee8d commit ac15b2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Changes:
- Changed ``OpenSSL.crypto.X509Store.add_crl`` to also accept
``cryptography``'s ``X509.CertificateRevocationList`` arguments in addition
to the now deprecated ``OpenSSL.crypto.CRL`` arguments.
- Fixed ``test_set_default_verify_paths`` test so that it is skipped if no
network connection is available.

23.2.0 (2023-05-30)
-------------------
Expand Down
6 changes: 5 additions & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
AF_INET6,
MSG_PEEK,
SHUT_RDWR,
gaierror,
socket,
)
from sys import getfilesystemencoding, platform
Expand Down Expand Up @@ -1269,7 +1270,10 @@ def test_set_default_verify_paths(self):
)

client = socket_any_family()
client.connect(("encrypted.google.com", 443))
try:
client.connect(("encrypted.google.com", 443))
except gaierror:
pytest.skip("cannot connect to encrypted.google.com")
clientSSL = Connection(context, client)
clientSSL.set_connect_state()
clientSSL.set_tlsext_host_name(b"encrypted.google.com")
Expand Down

0 comments on commit ac15b2f

Please sign in to comment.