jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350972 )
Change subject: [test] skip __annotations__ in print_locals.py
......................................................................
[test] skip __annotations__ in print_locals.py
With py3.6 __annotations__ is an additional item in locals() but not
emulated in pwb. Skip it.
Bug: T164141
Change-Id: Ie0b0432781adcacf081517ef44198088d8e20720
---
M tests/pwb/print_locals.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/pwb/print_locals.py b/tests/pwb/print_locals.py
index de8b792..57951f8 100644
--- a/tests/pwb/print_locals.py
+++ b/tests/pwb/print_locals.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""Script that forms part of pwb_tests."""
#
-# (C) Pywikibot team, 2013-2015
+# (C) Pywikibot team, 2013-2017
#
# Distributed under the terms of the MIT license.
#
@@ -12,7 +12,7 @@
for k, v in sorted(locals().copy().items()):
# Skip a few items that Python 3 adds and are not emulated in pwb.
- if k in ['__cached__', '__loader__', '__spec__']:
+ if k in ['__cached__', '__loader__', '__spec__', '__annotations__']:
continue
if k == '__file__':
print("__file__: %r" % os.path.join('.', os.path.relpath(__file__)))
--
To view, visit https://gerrit.wikimedia.org/r/350972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0b0432781adcacf081517ef44198088d8e20720
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350978 )
Change subject: Flake8: Ignore the new errors that have occured after pydocstyle upgrade
......................................................................
Flake8: Ignore the new errors that have occured after pydocstyle upgrade
Also update dependencies.
Bug: T164142
Change-Id: I664f60f3dd8f6d1036551df2602fed4c2e829482
---
M tox.ini
1 file changed, 15 insertions(+), 3 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tox.ini b/tox.ini
index d702afe..df26e44 100644
--- a/tox.ini
+++ b/tox.ini
@@ -52,9 +52,9 @@
basepython = python2.7
deps = flake8<3
pyflakes >= 1.1
- pydocstyle != 2.0.0
+ pydocstyle >= 2.0.0
hacking
- flake8-docstrings>=0.2.6
+ flake8-docstrings>=1.1.0
flake8-putty>=0.3.2
flake8-coding<1.3.0
flake8-comprehensions
@@ -137,7 +137,19 @@
# H201: Except: format
# N802, N803, N806 : naming convention
# P102,P103: string does contain unindexed parameters; see I36355923
-ignore = C401,C402,C405,E402,D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H201,H236,H301,H404,H405,I100,I101,N802,N803,N806
+
+# Errors occured after upgrade to pydocstyle 2.0.0 (T164142)
+# D211: No blank lines allowed before class docstring
+# D102: Missing docstring in public method
+# D401: First line should be in imperative mood; try rephrasing
+# E241: multiple spaces after ':'
+# E305: expected 2 blank lines after class or function definition
+# D413: Missing blank line after last section
+# D300: Use """triple double quotes"""
+# D412: No blank lines allowed between a section header and its content
+# E731: do not assign a lambda expression, use a def
+
+ignore = C401,C402,C405,E402,D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H201,H236,H301,H404,H405,I100,I101,N802,N803,N806,D211,D102,D401,E241,E305,D413,D103,D300,D412,E731
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
min-version = 2.6
max_line_length = 100
--
To view, visit https://gerrit.wikimedia.org/r/350978
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I664f60f3dd8f6d1036551df2602fed4c2e829482
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350536 )
Change subject: pagegenerators_tests.py: Fix test_unconnected_with_repo
......................................................................
pagegenerators_tests.py: Fix test_unconnected_with_repo
- Use `datetime.utcnow()` instead of `datetime.now()`.
- Increase the time buffer to 30 minutes, this is to make sure the
item has not been connected recently.
- Use `UnconnectedPageGenerator` instead of `site.unconnected_pages`.
`site.unconnected_pages` is tested separately in
`site_tests.TestSiteGeneratorsUncached.test_unconnected`.
- Print the related `item` in the error message which will be
helpful in debugging.
Bug: T163975
Change-Id: I6c97c9c9f303de3033f68ced78dd933cd87a4b30
---
M tests/pagegenerators_tests.py
1 file changed, 7 insertions(+), 6 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 507cd0a..4d34212 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1355,11 +1355,12 @@
if self.site.hostname() == 'test.wikipedia.org':
raise unittest.SkipTest('test.wikipedia is misconfigured; T85358')
cnt = 0
- start_time = datetime.datetime.now() - datetime.timedelta(minutes=5)
# Pages which have been connected recently may still be reported as
- # unconnected. So try on an version that is a few minutes older if the
+ # unconnected. So try on a version that is a few minutes older if the
# tested site appears as a sitelink.
- for page in self.site.unconnected_pages(total=5):
+ start_time = \
+ datetime.datetime.utcnow() - datetime.timedelta(minutes=30)
+ for page in pagegenerators.UnconnectedPageGenerator(self.site, 3):
try:
item = pywikibot.ItemPage.fromPage(page)
except pywikibot.NoPage:
@@ -1371,10 +1372,10 @@
sitelinks = json.loads(revisions[0].text)['sitelinks']
self.assertNotIn(
self.site.dbName(), sitelinks,
- 'Page "{0}" is connected to a Wikibase '
- 'repository'.format(page.title()))
+ 'Page "{0}" is connected to {1} on Wikibase '
+ 'repository'.format(page.title(), item))
cnt += 1
- self.assertLessEqual(cnt, 5)
+ self.assertLessEqual(cnt, 3)
def test_unconnected_without_repo(self):
"""Test that it raises a ValueError on sites without repository."""
--
To view, visit https://gerrit.wikimedia.org/r/350536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6c97c9c9f303de3033f68ced78dd933cd87a4b30
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/349786 )
Change subject: Remove featured.py out of the script_tests.py
......................................................................
Remove featured.py out of the script_tests.py
- featured.py is archived and longer compatible with Wikimedia sites.
It is not tested anymore because it resides in archive folder.
The featured parts could be removed then.
Change-Id: I4ebb7de9a234a2da646f4b5a634851248a6ba478
---
M tests/script_tests.py
1 file changed, 1 insertion(+), 3 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 6bc8c32..7743c73 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test that each script can be compiled and executed."""
#
-# (C) Pywikibot team, 2014-2016
+# (C) Pywikibot team, 2014-2017
#
# Distributed under the terms of the MIT license.
#
@@ -120,7 +120,6 @@
'checkimages',
'clean_sandbox',
'disambredir',
- 'featured',
'imagerecat',
'login',
'lonelypages',
@@ -145,7 +144,6 @@
no_args_expected_results = {
# TODO: until done here, remember to set editor = None in user_config.py
'editarticle': 'Nothing changed',
- 'featured': '0 pages written.',
'freebasemappingupload': 'Cannot find ',
'harvest_template': 'ERROR: Please specify',
'imageuncat': 'WARNING: This script is primarily written for Wikimedia Commons',
--
To view, visit https://gerrit.wikimedia.org/r/349786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4ebb7de9a234a2da646f4b5a634851248a6ba478
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>