jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510687 )
Change subject: [bugfix] fromlist identifiers must not be unicode in Python 2
......................................................................
[bugfix] fromlist identifiers must not be unicode in Python 2
detached from I1d12bfa2
Change-Id: I6186954414192cb51d1364eba780adbc14dc8d99
---
M pywikibot/__init__.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index f032eb1..f7504d3 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1256,6 +1256,8 @@
if not isinstance(interface, type):
# If it isn't a class, assume it is a string
+ if PY2: # Must not be unicode in Python 2
+ interface = str(interface)
try:
tmp = __import__('pywikibot.site', fromlist=[interface])
except ImportError:
--
To view, visit https://gerrit.wikimedia.org/r/510687
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6186954414192cb51d1364eba780adbc14dc8d99
Gerrit-Change-Number: 510687
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510995 )
Change subject: [doc] remove deprecated PageNotFound from doc
......................................................................
[doc] remove deprecated PageNotFound from doc
PageNotFound exceptions is not used by pwb framework anymore
Change-Id: Ib4ebedf847f0803652b02c7ea9804bfbb6b1a737
---
M pywikibot/exceptions.py
1 file changed, 0 insertions(+), 1 deletion(-)
Approvals:
Zhuyifei1999: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index af759ba..68f01d0 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -12,7 +12,6 @@
- InvalidTitle: Invalid page title
- CaptchaError: Captcha is asked and config.solve_captcha == False
- Server504Error: Server timed out with HTTP 504 code
- - PageNotFound: Page not found (deprecated)
- i18n.TranslationError: i18n/l10n message not available
- UnknownExtension: Extension is not defined for this site
--
To view, visit https://gerrit.wikimedia.org/r/510995
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4ebedf847f0803652b02c7ea9804bfbb6b1a737
Gerrit-Change-Number: 510995
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510446 )
Change subject: [bugfix] Enable all families are tested in TestFamilyUrlRegex.test_each_family
......................................................................
[bugfix] Enable all families are tested in TestFamilyUrlRegex.test_each_family
With skipTest the whole test is skipped if the condition was reached.
In this case all tests after 'lyricwiki' was found in config.family_files
where droppend and btw the order of the config.family_files.keys seems
not deterministic.
With this patch a subTest is used. subTest was introduced with Python 3.4.
After we annouced to drop Python 2 it is not necessary to backport this
context manager or find another solution. Just skip this test for older
Pythons.
Bug: T223367
Change-Id: Ief76609cfbdc976a34f5161373015ab25343860f
---
M tests/family_tests.py
1 file changed, 19 insertions(+), 17 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/family_tests.py b/tests/family_tests.py
index e529066..43db8ed 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -237,23 +237,25 @@
def test_each_family(self):
"""Test each family builds a working regex."""
for family in pywikibot.config.family_files:
- if family in ('wowwiki', 'lyricwiki'):
- self.skipTest(
- 'Family.from_url() does not work for {} (T215077)'
- .format(family))
- self.current_family = family
- family = Family.load(family)
- for code in family.codes:
- self.current_code = code
- url = ('{}://{}{}/$1'.format(family.protocol(code),
- family.hostname(code),
- family.path(code)))
- # Families can switch off if they want to be detected using URL
- # this applies for test:test (there is test:wikipedia)
- if family._ignore_from_url or code in family._ignore_from_url:
- self.assertIsNone(family.from_url(url))
- else:
- self.assertEqual(family.from_url(url), code)
+ with self.subTest(family=family):
+ if family in ('wowwiki', 'lyricwiki'):
+ self.skipTest(
+ 'Family.from_url() does not work for {} (T215077)'
+ .format(family))
+ self.current_family = family
+ family = Family.load(family)
+ for code in family.codes:
+ self.current_code = code
+ url = ('{}://{}{}/$1'.format(family.protocol(code),
+ family.hostname(code),
+ family.path(code)))
+ # Families can switch off if they want to be detected using
+ # URL. This applies for test:test (there is test:wikipedia)
+ if (family._ignore_from_url
+ or code in family._ignore_from_url):
+ self.assertIsNone(family.from_url(url))
+ else:
+ self.assertEqual(family.from_url(url), code)
class TestOldFamilyMethod(DeprecationTestCase):
--
To view, visit https://gerrit.wikimedia.org/r/510446
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ief76609cfbdc976a34f5161373015ab25343860f
Gerrit-Change-Number: 510446
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <andre.costa(a)wikimedia.se>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Hashar <hashar(a)free.fr>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510556 )
Change subject: [tests] Enable subTest context manager for Python 2
......................................................................
[tests] Enable subTest context manager for Python 2
This allows using of subTest with Python 3 inside tests without
breaking Python 2.
Change-Id: I7cc6666ddb51f108f4cbc72405d30c2aba638da8
---
M tests/aspects.py
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index ada517d..6695894 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -63,6 +63,12 @@
"""Base class for all tests."""
+ if not hasattr(unittest.TestCase, 'subTest'):
+ @contextmanager
+ def subTest(self, *args, **kwargs):
+ """Dummy subTest context manager for Python 2 that does nothing."""
+ yield
+
if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
def assertRaisesRegex(self, *args, **kwargs):
"""
--
To view, visit https://gerrit.wikimedia.org/r/510556
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7cc6666ddb51f108f4cbc72405d30c2aba638da8
Gerrit-Change-Number: 510556
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)