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:

-- 
To view, visit https://gerrit.wikimedia.org/r/370663
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9c1af39b1c1e82da58f78b1b4331411bc059a790
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Strainu <w...@strainu.ro>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to