jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1335043?usp=email )
Change subject: tests: Reuse purge result in page test
......................................................................
tests: Reuse purge result in page test
Reuse the initial purge response when comparing it with a call using
forcelinkupdate=None. This avoids one redundant live API request.
Bug: T434934
Change-Id: Id606961da876ecb2e56d263d99c110e363d4933f
---
M tests/page_tests.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/page_tests.py b/tests/page_tests.py
index b12547f..c10bc1b 100755
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -1178,8 +1178,9 @@
def test_purge(self) -> None:
"""Test purging the mainpage."""
mainpage = self.get_mainpage()
- self.assertIsInstance(mainpage.purge(), bool)
- self.assertEqual(mainpage.purge(),
+ result = mainpage.purge()
+ self.assertIsInstance(result, bool)
+ self.assertEqual(result,
mainpage.purge(forcelinkupdate=None))
def test_watch(self) -> None:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1335043?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id606961da876ecb2e56d263d99c110e363d4933f
Gerrit-Change-Number: 1335043
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]