nixpkgs/pkgs/development/python-modules/cheroot/tests.patch
2019-08-22 15:34:49 +02:00

46 lines
1.7 KiB
Diff

diff --git a/cheroot/test/test_ssl.py b/cheroot/test/test_ssl.py
index fe8a0a0..92a77c1 100644
--- a/cheroot/test/test_ssl.py
+++ b/cheroot/test/test_ssl.py
@@ -316,11 +316,9 @@ def test_tls_client_auth(
expected_ssl_errors = (
requests.exceptions.SSLError,
OpenSSL.SSL.Error,
- ) if PY34 else (
- requests.exceptions.SSLError,
+ requests.exceptions.ConnectionError,
)
- if IS_WINDOWS:
- expected_ssl_errors += requests.exceptions.ConnectionError,
+
with pytest.raises(expected_ssl_errors) as ssl_err:
make_https_request()
@@ -335,7 +333,7 @@ def test_tls_client_auth(
except AttributeError:
if PY34:
pytest.xfail('OpenSSL behaves wierdly under Python 3.4')
- elif six.PY3 and IS_WINDOWS:
+ elif six.PY3:
err_text = str(ssl_err.value)
else:
raise
@@ -348,8 +346,7 @@ def test_tls_client_auth(
if IS_MACOS and IS_PYPY and adapter_type == 'pyopenssl':
expected_substrings = ('tlsv1 alert unknown ca', )
if (
- IS_WINDOWS
- and tls_verify_mode in (
+ tls_verify_mode in (
ssl.CERT_REQUIRED,
ssl.CERT_OPTIONAL,
)
@@ -361,6 +358,7 @@ def test_tls_client_auth(
"SysCallError(10054, 'WSAECONNRESET')",
"('Connection aborted.', "
'OSError("(10054, \'WSAECONNRESET\')"))',
+ 'OSError("(104, \'ECONNRESET\')"))',
)
assert any(e in err_text for e in expected_substrings)