jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1191295?usp=email )
Change subject: Tests: Fix TestBacklinks tests in site_generators_tests.py
......................................................................
Tests: Fix TestBacklinks tests in site_generators_tests.py
The tests fails because of the pages isn't only referenced as a
redirect but also transcluded by a bot template. Remove these
transclusion by with_template_inclusion=False setting
Bug: T405449
Change-Id: I65d79528b942827df66c34dae7c088d952000386
---
M tests/site_generators_tests.py
1 file changed, 17 insertions(+), 9 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/site_generators_tests.py b/tests/site_generators_tests.py
index 8b38a9e..063bb0c 100755
--- a/tests/site_generators_tests.py
+++ b/tests/site_generators_tests.py
@@ -1798,15 +1798,23 @@
"""Set up tests."""
super().setUp()
self.page = pywikibot.Page(self.site, 'File:BoA – Woman.png')
- self.backlinks = list(self.page.backlinks(follow_redirects=False,
- filter_redirects=True,
- total=5))
- self.references = list(self.page.getReferences(follow_redirects=True,
- filter_redirects=True,
- total=5))
- self.nofollow = list(self.page.getReferences(follow_redirects=False,
- filter_redirects=True,
- total=5))
+ self.backlinks = list(
+ self.page.backlinks(follow_redirects=False,
+ filter_redirects=True,
+ total=5)
+ )
+ self.references = list(
+ self.page.getReferences(follow_redirects=True,
+ filter_redirects=True,
+ with_template_inclusion=False,
+ total=5)
+ )
+ self.nofollow = list(
+ self.page.getReferences(follow_redirects=False,
+ filter_redirects=True,
+ with_template_inclusion=False,
+ total=5)
+ )
def test_backlinks_redirects_length(self) -> None:
"""Test backlinks redirects length."""
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1191295?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: I65d79528b942827df66c34dae7c088d952000386
Gerrit-Change-Number: 1191295
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[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]