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()
--
To view, visit
https://gerrit.wikimedia.org/r/491052
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I916020c9cf8bdd3a840cb23730aa5b337029dac4
Gerrit-Change-Number: 491052
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)