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))
pywikibot-commits@lists.wikimedia.org