jenkins-bot merged this change.

View Change

Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
[bugfix] Adjust page counter in LiveBotTestCase

- With Id9885f7a the page counter was adjusted and skipped pages are
no longer counted. Adjust page counter in LiveBotTestCase._missing_generator
- Also fix message strings. str.format can handle properties or
attribute only but it fails for functions.

Bug: T195696
Change-Id: I7a7e5c55c5f1e7859078174cb89110b55e4e2502
M pywikibot/
M tests/
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pywikibot/ b/pywikibot/
index 44664f5..7eaae7c 100644
--- a/pywikibot/
+++ b/pywikibot/
@@ -1621,7 +1621,7 @@
"""Skip page it's site is not on the defined site."""
if !=
- fill('Skipped "{page}" due to: '
+ fill('Skipped {page} due to: '
'The bot is on site "{site}" but the page on '
'site "{}"'.format(, page=page)))
return True
@@ -1760,7 +1760,7 @@
"""Treat page if it exists and handle NoPage from it."""
if not page.exists():
- 'Page "{page.title()}" does not exist on {}.'
+ 'Page {page} does not exist on {}.'
return True
return super(ExistingPageBot, self).skip_page(page)
@@ -1785,7 +1785,7 @@
"""Treat page if doesn't exist."""
if page.exists():
- 'Page "{page.title()}" does already exist on {}.'
+ 'Page {page} does already exist on {}.'
return True
return super(CreatingPageBot, self).skip_page(page)
@@ -1799,7 +1799,7 @@
"""Treat only redirect pages and handle IsNotRedirectPage from it."""
if not page.isRedirectPage():
- 'Page "{page.title()}" on {} is skipped because it is'
+ 'Page {page} on {} is skipped because it is'
'not a redirect'.format(page=page))
return True
return super(RedirectPageBot, self).skip_page(page)
@@ -1813,7 +1813,7 @@
"""Treat only non-redirect pages and handle IsRedirectPage from it."""
if page.isRedirectPage():
- 'Page "{page.title()}" on {} is skipped because it is'
+ 'Page {page} on {} is skipped because it is'
'a redirect'.format(page=page))
return True
return super(NoRedirectPageBot, self).skip_page(page)
diff --git a/tests/ b/tests/
index 5cfade3..da9c7b3 100644
--- a/tests/
+++ b/tests/
@@ -314,7 +314,7 @@

def _missing_generator(self):
"""Yield pages and the last one does not exist."""
- self._count = 1
+ self._count = 0 # skip_page skips one page
self._current_page = list([0]
yield self._current_page
while self._current_page.exists():

To view, visit change 435696. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a7e5c55c5f1e7859078174cb89110b55e4e2502
Gerrit-Change-Number: 435696
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <>
Gerrit-Reviewer: Dalba <>
Gerrit-Reviewer: John Vandenberg <>
Gerrit-Reviewer: Zoranzoki21 <>
Gerrit-Reviewer: jenkins-bot <>