jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/463049 )
Change subject: [test] Skip hidden log entry instead of failing tests ......................................................................
[test] Skip hidden log entry instead of failing tests
Bug: T205532 Change-Id: Ibd14cc5383567e8fbea62239093c0f73d9a6bfb6 --- M tests/site_tests.py 1 file changed, 8 insertions(+), 5 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index c875938..837364e 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -20,12 +20,10 @@
import pywikibot
-from pywikibot import config - +from pywikibot import async_request, config, page_put_queue from pywikibot.comms import http from pywikibot.data import api - -from pywikibot import async_request, page_put_queue +from pywikibot.exceptions import HiddenKeyError from pywikibot.tools import ( MediaWikiVersion, PY2, @@ -1325,7 +1323,12 @@ """Test the deprecated site.logpages() when namespace is a list.""" le = list(self.site.logpages(namespace=[2, 3], number=10)) for entry in le: - self.assertIn(entry[0].namespace(), [2, 3]) + try: + self.assertIn(entry[0].namespace(), [2, 3]) + except HiddenKeyError as e: + raise unittest.SkipTest( + 'Log entry {entry} is hidden:\n{entry.data}\n{error!r}' + .format(entry=entry, error=e))
def test_logpages_dump(self): """Test the deprecated site.logpages() method using dump mode."""
pywikibot-commits@lists.wikimedia.org