jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620372 )
Change subject: [4.0] Remove Python 2 code from site_detect_tests.py ......................................................................
[4.0] Remove Python 2 code from site_detect_tests.py
Change-Id: I135f102d4f4faf749c8e898b256e24582290e06d --- M tests/site_detect_tests.py 1 file changed, 4 insertions(+), 11 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py index 0eab946..5695266 100644 --- a/tests/site_detect_tests.py +++ b/tests/site_detect_tests.py @@ -5,25 +5,20 @@ # # Distributed under the terms of the MIT license. # - -from __future__ import absolute_import, division, unicode_literals +from contextlib import suppress +from urllib.parse import urlparse
from requests.exceptions import ConnectionError, Timeout
import pywikibot + from pywikibot.exceptions import ServerError from pywikibot.site_detect import MWSite -from pywikibot.tools import PY2
from tests import unittest_print from tests.aspects import unittest, TestCase, PatchingTestCase from tests.utils import DrySite
-if not PY2: - from urllib.parse import urlparse -else: - from urlparse import urlparse -
class SiteDetectionTestCase(TestCase):
@@ -345,7 +340,5 @@
if __name__ == '__main__': # pragma: no cover - try: + with suppress(SystemExit): unittest.main() - except SystemExit: - pass
pywikibot-commits@lists.wikimedia.org