jenkins-bot has submitted this change and it was merged.
Change subject: Fix ScriptTest metaclass super __new__
......................................................................
Fix ScriptTest metaclass super __new__
Attributes like 'user' and 'net' have not been set on script tests
as the metaclass did not invoke the super meta-classes' __new__.
Change-Id: Ied762af1fb2099a3fb4f906306068546ebb99606
---
M tests/script_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index f4252e3..39a783d 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -398,7 +398,7 @@
#
# dct[test_name].site = True
- return type.__new__(cls, name, bases, dct)
+ return super(TestScriptMeta, cls).__new__(cls, name, bases, dct)
class TestScript(DefaultSiteTestCase, PwbTestCase):
@@ -412,8 +412,8 @@
__metaclass__ = TestScriptMeta
def setUp(self):
- super(TestScript, self).setUp()
"""Prepare the environment for running the pwb.py script."""
+ super(TestScript, self).setUp()
self.old_pywikibot_dir = None
if 'PYWIKIBOT2_DIR' in os.environ:
self.old_pywikibot_dir = os.environ['PYWIKIBOT2_DIR']
--
To view, visit https://gerrit.wikimedia.org/r/171213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ied762af1fb2099a3fb4f906306068546ebb99606
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Export sys.path to pwb scripts
......................................................................
Export sys.path to pwb scripts
setup.py can install packages, which are available within the
unit tests as it adds the packages to sys.path.
script_tests needs to export sys.path into the script environment
so these packages may be imported by the script.
Also move a docstring which was incorrectly placed inside the method
procedure.
Bug: 71864
Change-Id: I6356b4b5d8da7529957befe8157f78457ebb5df1
---
M tests/script_tests.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index f4252e3..af9e37a 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -207,6 +207,8 @@
return stream.decode(config.console_encoding)
else:
return stream
+ env = os.environ.copy()
+ env['PYTHONPATH'] = ":".join(sys.path)
options = {
'stdout': subprocess.PIPE,
'stderr': subprocess.PIPE
@@ -214,7 +216,7 @@
if data_in is not None:
options['stdin'] = subprocess.PIPE
- p = subprocess.Popen(command, **options)
+ p = subprocess.Popen(command, env=env, **options)
if data_in is not None:
if sys.version_info[0] > 2:
@@ -412,8 +414,8 @@
__metaclass__ = TestScriptMeta
def setUp(self):
- super(TestScript, self).setUp()
"""Prepare the environment for running the pwb.py script."""
+ super(TestScript, self).setUp()
self.old_pywikibot_dir = None
if 'PYWIKIBOT2_DIR' in os.environ:
self.old_pywikibot_dir = os.environ['PYWIKIBOT2_DIR']
--
To view, visit https://gerrit.wikimedia.org/r/171194
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6356b4b5d8da7529957befe8157f78457ebb5df1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Use unittest 0.6.0
......................................................................
Use unittest 0.6.0
Unittest 0.7+ is going to behave like unittest from Python 3.4,
which is that expectedFailure's must fail, which is different
from Python 2.7 and 3.3 unittest.
https://code.google.com/p/unittest-ext/issues/detail?id=85
Bug: 72801
Change-Id: I7480b6021c76aa4383140e229b6c877a6833a7ef
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index fe58fc3..9525f49 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@
- sudo apt-get install -y liblua5.1-dev
install:
- - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install ordereddict unittest2; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install ordereddict unittest2==0.6.0; fi
- pip install six
- mkdir ~/.pywikibot
--
To view, visit https://gerrit.wikimedia.org/r/171243
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7480b6021c76aa4383140e229b6c877a6833a7ef
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: cosmetic-changes.py: fix error in docstring
......................................................................
cosmetic-changes.py: fix error in docstring
Fixed error in docstring of method:
- removeNonBreakingSpaceBeforePercent()
Bug: 72941
Change-Id: Ie141179e7a1f240aeb567b75745012b085fa0c18
---
M scripts/cosmetic_changes.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index dd4dfdd..5776a6e 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -594,7 +594,7 @@
def removeNonBreakingSpaceBeforePercent(self, text):
"""
- Insert a non-breaking space between number and percent sign.
+ Remove a non-breaking space between number and percent sign.
Newer MediaWiki versions automatically place a non-breaking space in
front of a percent sign, so it is no longer required to place it
--
To view, visit https://gerrit.wikimedia.org/r/171142
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie141179e7a1f240aeb567b75745012b085fa0c18
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: pep257: adding docstrings to pagegenerators.py:
......................................................................
pep257: adding docstrings to pagegenerators.py:
Now pagegenerators.py does not show pep257 errors.
Fixed also lines > 80 chars.
Change-Id: I6ace68bfeceb1f6ddf5f44bb2efe48dbd7b7318d
---
M pywikibot/pagegenerators.py
1 file changed, 13 insertions(+), 4 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e00983a..3e77643 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -138,7 +138,8 @@
Argument can be given as "-unusedfiles:n" where
n is the maximum number of articles to work on.
--lonelypages Work on all articles that are not linked from any other article.
+-lonelypages Work on all articles that are not linked from any other
+ article.
Argument can be given as "-lonelypages:n" where
n is the maximum number of articles to work on.
@@ -298,7 +299,7 @@
# Insert Category: before category name to avoid parsing problems in
# Link.parse() when categoryname contains ":";
# Part before ":" might be interpreted as an interwiki prefix
- prefix = categoryname.split(":", 1)[0] # whole word if no ":" is present
+ prefix = categoryname.split(":", 1)[0] # whole word if ":" not present
if prefix not in self.site.namespaces()[14]:
categoryname = u'{0}:{1}'.format(self.site.namespace(14),
categoryname)
@@ -514,7 +515,8 @@
gen = NewimagesPageGenerator(total=int(limit), site=self.site)
elif arg.startswith('-newpages'):
# partial workaround for bug 67249
- # to use -namespace/ns with -newpages, -ns must be given before -newpages
+ # to use -namespace/ns with -newpages, -ns must be given
+ # before -newpages
# otherwise default namespace is 0
namespaces = self.namespaces or 0
total = 60
@@ -537,7 +539,8 @@
mediawikiQuery = pywikibot.input(
u'What do you want to search for?')
# In order to be useful, all namespaces are required
- gen = SearchPageGenerator(mediawikiQuery, namespaces=[], site=self.site)
+ gen = SearchPageGenerator(mediawikiQuery,
+ namespaces=[], site=self.site)
elif arg.startswith('-google'):
gen = GoogleSearchPageGenerator(arg[8:])
elif arg.startswith('-titleregex'):
@@ -725,10 +728,12 @@
def FileLinksGenerator(referredFilePage, step=None, total=None, content=False):
+ """Yield Pages on which the file referredFilePage is displayed."""
return referredFilePage.usingPages(step=step, total=total, content=content)
def ImagesPageGenerator(pageWithImages, step=None, total=None, content=False):
+ """Yield FilePages displayed on pageWithImages."""
return pageWithImages.imagelinks(step=step, total=total, content=content)
@@ -1055,6 +1060,7 @@
def CombinedPageGenerator(generators):
+ """Yield from each iterable until exhausted, then proceed with the next."""
return itertools.chain(*generators)
@@ -1176,6 +1182,7 @@
def DequePreloadingGenerator(generator, step=50):
+ """Preload generator of type DequeGenerator."""
assert(isinstance(generator, DequeGenerator))
while True:
@@ -1617,6 +1624,7 @@
yield url
def __iter__(self):
+ """Iterate results."""
# restrict query to local site
localQuery = '%s site:%s' % (self.query, self.site.hostname())
base = 'http://%s%s' % (self.site.hostname(),
@@ -1682,6 +1690,7 @@
yield url
def __iter__(self):
+ """Iterate results."""
# restrict query to local site
localQuery = '%s site:%s' % (self.query, self.site.hostname())
base = 'http://%s%s' % (self.site.hostname(),
--
To view, visit https://gerrit.wikimedia.org/r/171049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6ace68bfeceb1f6ddf5f44bb2efe48dbd7b7318d
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Revert "[FIX] Archivebot: Don't test uz wp"
......................................................................
Revert "[FIX] Archivebot: Don't test uz wp"
The page's format invalid.
This reverts commit 7aa2aa458e5b357c513c2dc0c0ac1fe5ea57eae1.
Change-Id: I249bade42269e21efd150b65b0f6d4370b4493e2
---
M tests/archivebot_tests.py
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index 9803cf1..5c57d54 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -70,7 +70,7 @@
self.assertIsInstance(thread.content, basestring)
self.assertIsInstance(thread.timestamp, datetime)
- expected_failures = ['ar', 'pdc', 'th', 'uz']
+ expected_failures = ['ar', 'pdc', 'th']
# expected failures - should be fixed
# 'ar': Uses Arabic acronym for TZ
# 'pdc': changed month name setting in wiki over time (?)
@@ -78,7 +78,6 @@
# <message name="feb" xml:space="preserve">Han.</message>.
# for new entries it should work
# 'th': year is 2552 while regex assumes 19..|20.., might be fixed
- # 'uz': a dash between day and month (24-Oktabr)
if __name__ == '__main__':
--
To view, visit https://gerrit.wikimedia.org/r/170933
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I249bade42269e21efd150b65b0f6d4370b4493e2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>