jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/682925 )
Change subject: [tests] Fix TooManyRedirects failure for test_merriam_webster
......................................................................
[tests] Fix TooManyRedirects failure for test_merriam_webster
Catch requests.exceptions.TooManyRedirects exception as an
requested result if no Site can be created from this Url.
Bug: T281236
Change-Id: I65303f94a98319c4b028a3755bbd9072f643ff87
---
M tests/site_detect_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Damian: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index 807d105..6e4d254 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -10,7 +10,7 @@
from http import HTTPStatus
from urllib.parse import urlparse
-from requests.exceptions import ConnectionError, Timeout
+from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
import pywikibot
@@ -48,7 +48,7 @@
@raises AssertionError: Site under url is MediaWiki powered
"""
with self.assertRaises((AttributeError, ConnectionError, RuntimeError,
- ServerError, Timeout)) as e:
+ ServerError, Timeout, TooManyRedirects)) as e:
MWSite(url)
unittest_print('\nassertNoSite expected exception:\n{e!r}'
.format(e=e.exception))
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/682925
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I65303f94a98319c4b028a3755bbd9072f643ff87
Gerrit-Change-Number: 682925
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged