jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377067 )
Change subject: [bugfix] Check KeyError for hidden logentry comment ......................................................................
[bugfix] Check KeyError for hidden logentry comment
Bug: T175496 Change-Id: Ie51178dd457dcaa9c39345014d1d0f1e48e5c36b --- M tests/logentry_tests.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py index cf96995..e32f3d3 100644 --- a/tests/logentry_tests.py +++ b/tests/logentry_tests.py @@ -75,7 +75,10 @@ else: self.assertNotIn(logentry.type(), logentry.data) self.assertIsInstance(logentry.action(), unicode) - self.assertIsInstance(logentry.comment(), unicode) + if hasattr(logentry, 'comment'): + self.assertIsInstance(logentry.comment(), unicode) + else: + self.assertRaises(KeyError, logentry.comment) self.assertIsInstance(logentry.logid(), int) self.assertIsInstance(logentry.ns(), int) self.assertIsInstance(logentry.pageid(), int)
pywikibot-commits@lists.wikimedia.org