From 0187386eab51ea4309755bb9f9c7ebfe9409232e Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Aug 2018 14:09:28 +0400 Subject: [PATCH] test_https: Fix Windows error exception type --- test/with_dummyserver/test_https.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index 6e558d3561..f41ba892a3 100644 --- a/test/with_dummyserver/test_https.py +++ b/test/with_dummyserver/test_https.py @@ -38,6 +38,7 @@ SystemTimeWarning, InsecurePlatformWarning, MaxRetryError, + ProtocolError, ) from urllib3.packages import six from urllib3.util.timeout import Timeout @@ -102,8 +103,10 @@ def test_client_no_intermediate(self): 'unknown Cert Authority' in str(e) or # https://github.com/urllib3/urllib3/issues/1422 'connection closed via error' in str(e) or - 'WSAECONNRESET' in str(e) or - 'An existing connection was forcibly closed by the remote host' in str(e)): + 'WSAECONNRESET' in str(e)): + raise + except ProtocolError as e: + if not ('An existing connection was forcibly closed by the remote host' in str(e)): raise def test_verified(self):