jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[tests] Skip requests.exceptions.Timeout in HttpbinTestCase.fetch()

Change-Id: Ib416cfd6b98e1b80eace1297bf08f28065ec5319
---
M pywikibot/comms/http.py
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 319f512..3edca31 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -326,6 +326,11 @@
and re.search(r'\[Errno (-2|8|11001)\]', msg):
raise ConnectionError(response)

+ # catch requests.ReadTimeout and requests.ConnectTimeout and convert
+ # it to ServerError
+ if isinstance(response, requests.Timeout):
+ raise ServerError(response)
+
if isinstance(response, Exception):
with suppress(Exception):
# request exception may contain response and request attribute

To view, visit change 917357. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib416cfd6b98e1b80eace1297bf08f28065ec5319
Gerrit-Change-Number: 917357
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged