jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/370663 )
Change subject: [bugfix] Maybe mainpage image does not exist ......................................................................
[bugfix] Maybe mainpage image does not exist
Ignore the test when the image is None
Change-Id: I9c1af39b1c1e82da58f78b1b4331411bc059a790 --- M tests/page_tests.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Strainu: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/page_tests.py b/tests/page_tests.py index b4d9a5e..17c69ef 100644 --- a/tests/page_tests.py +++ b/tests/page_tests.py @@ -563,7 +563,10 @@ if MediaWikiVersion(site.version()) < MediaWikiVersion('1.20'): self.assertRaises(NotImplementedError, mainpage.page_image) elif site.has_extension('PageImages'): - self.assertIsInstance(mainpage.page_image(), pywikibot.FilePage) + image = mainpage.page_image() + if image is not None: + self.assertIsInstance(mainpage.page_image(), + pywikibot.FilePage) # for file pages, the API should return the file itself self.assertEqual(image.page_image(), image) else:
pywikibot-commits@lists.wikimedia.org