Skip to content

Commit

Permalink
[tests] Skip interwiki link test until the problem is solved upstream
Browse files Browse the repository at this point in the history
Bug: T356009
Change-Id: I25afe1bd2042002bcd1bcd196d83106d701ef756
  • Loading branch information
xqt committed Jan 28, 2024
1 parent 788e5dc commit 4d38586
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/page_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
UnknownExtensionError,
)
from pywikibot.tools import suppress_warnings
from tests import WARN_SITE_CODE
from tests import WARN_SITE_CODE, unittest_print
from tests.aspects import (
DefaultDrySiteTestCase,
DefaultSiteTestCase,
Expand Down Expand Up @@ -522,15 +522,21 @@ def testLinks(self):
mainpage = self.get_mainpage()
for p in mainpage.linkedPages():
self.assertIsInstance(p, pywikibot.Page)
iw = list(mainpage.interwiki(expand=True))
for p in iw:
self.assertIsInstance(p, pywikibot.Link)
for p2 in mainpage.interwiki(expand=False):
self.assertIsInstance(p2, pywikibot.Link)
self.assertIn(p2, iw)

if mainpage.site.sitename == 'wikipedia:en':
unittest_print('Skipping interwiki link test due to T356009')
else:
iw = set(mainpage.interwiki(expand=True))
for link in iw:
self.assertIsInstance(link, pywikibot.Link)
for link in mainpage.interwiki(expand=False):
self.assertIsInstance(link, pywikibot.Link)
self.assertIn(link, iw)

with suppress_warnings(WARN_SITE_CODE, category=UserWarning):
for p in mainpage.langlinks():
self.assertIsInstance(p, pywikibot.Link)

for p in mainpage.imagelinks():
self.assertIsInstance(p, pywikibot.FilePage)
for p in mainpage.templates():
Expand Down

0 comments on commit 4d38586

Please sign in to comment.