Skip to content

Commit ac15b2f

Browse files
authored
Fix failing test when running offline (#1261)
1 parent bbcee8d commit ac15b2f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Changes:
3333
- Changed ``OpenSSL.crypto.X509Store.add_crl`` to also accept
3434
``cryptography``'s ``X509.CertificateRevocationList`` arguments in addition
3535
to the now deprecated ``OpenSSL.crypto.CRL`` arguments.
36+
- Fixed ``test_set_default_verify_paths`` test so that it is skipped if no
37+
network connection is available.
3638

3739
23.2.0 (2023-05-30)
3840
-------------------

tests/test_ssl.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
AF_INET6,
2828
MSG_PEEK,
2929
SHUT_RDWR,
30+
gaierror,
3031
socket,
3132
)
3233
from sys import getfilesystemencoding, platform
@@ -1269,7 +1270,10 @@ def test_set_default_verify_paths(self):
12691270
)
12701271

12711272
client = socket_any_family()
1272-
client.connect(("encrypted.google.com", 443))
1273+
try:
1274+
client.connect(("encrypted.google.com", 443))
1275+
except gaierror:
1276+
pytest.skip("cannot connect to encrypted.google.com")
12731277
clientSSL = Connection(context, client)
12741278
clientSSL.set_connect_state()
12751279
clientSSL.set_tlsext_host_name(b"encrypted.google.com")

0 commit comments

Comments
 (0)