jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/491052 )
Change subject: [tests] Skip page_tests.TestPageUserAction if site is readonly ......................................................................
[tests] Skip page_tests.TestPageUserAction if site is readonly
- purge and watch method cannot be done for an site with readonly state. Skip the tests in that case.
Bug: T216358 Change-Id: I916020c9cf8bdd3a840cb23730aa5b337029dac4 --- M tests/page_tests.py 1 file changed, 12 insertions(+), 0 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/page_tests.py b/tests/page_tests.py index 0dbd553..ab7fd24 100644 --- a/tests/page_tests.py +++ b/tests/page_tests.py @@ -972,6 +972,18 @@
user = True
+ @classmethod + def setUpClass(cls): + """Set up the test class. + + Check whether the site is write protected and skip the tests then. + """ + super(TestPageUserAction, cls).setUpClass() + site = cls.get_site() + if site.siteinfo['readonly']: + raise unittest.SkipTest('Site {} has readonly state: {}'.format( + site, site.siteinfo.get('readonlyreason', ''))) + def test_purge(self): """Test purging the mainpage.""" mainpage = self.get_mainpage()
pywikibot-commits@lists.wikimedia.org