Skip to content

Commit

Permalink
tests: fix issue with ssl detection on test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Aug 27, 2024
1 parent 1fe4e17 commit 4f1b93f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions upath/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def xfail_if_version(module, *, reason, **conditions):
def xfail_if_no_ssl_connection(func):
try:
import requests

except ImportError:
return pytest.mark.skip(reason="requests not installed")(func)
try:
requests.get("https://example.com")
except (ImportError, requests.exceptions.SSLError):
except (requests.exceptions.ConnectionError, requests.exceptions.SSLError):
return pytest.mark.xfail(reason="No SSL connection")(func)
else:
return func
Expand Down

0 comments on commit 4f1b93f

Please sign in to comment.