jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1156316?usp=email )

Change subject: tests: fix LinksearchPageGenerator tests
......................................................................

tests: fix LinksearchPageGenerator tests

- use dewiki because of misermode when using namespace parameter.
  Test is 11 times faster now.
- use regex for wikipedia.org in test_weblink because the content
  can be any url ending with wikipedia.org but the protocol does match.
- remove unittest.skip, the tests might be fixed with T396280 already.

Bug: T396728
Change-Id: Ie9b53c5895c1377b9f24eb65c7299312be758db1
---
M tests/pagegenerators_tests.py
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 2adaba4..9260047 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1724,15 +1724,16 @@
     """Tests for pagegenerators.LinksearchPageGenerator."""

     family = 'wikipedia'
-    code = 'en'
+    code = 'de'

-    @unittest.expectedFailure  # T396728
     def test_weblink(self) -> None:
         """Test -weblink."""
-        cases = (('wikipedia.org', 'http://wikipedia.org'),
-                 ('en.wikipedia.org', 'http://en.wikipedia.org'),
-                 ('https://fr.wikipedia.org', 'https://fr.wikipedia.org'),
-                 ('ftp://*', 'ftp://'))
+        cases = (
+            ('wikipedia.org', 'wikipedia.org'),
+            ('en.wikipedia.org', 'http://en.wikipedia.org'),
+            ('https://fr.wikipedia.org', 'https://fr.wikipedia.org'),
+            ('ftp://*', 'ftp://')
+        )

         for search, expected in cases:
             with self.subTest(search=search, expected=expected):
@@ -1757,7 +1758,6 @@
                                                    protocol='https',
                                                    site=self.site)

-    @unittest.skip('Needs to be adapted for T14810')
     def test_double_same_protocols(self) -> None:
         """Test LinksearchPageGenerator with two same protocols."""
         gen = pagegenerators.LinksearchPageGenerator('https://w.wiki',

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1156316?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: Ie9b53c5895c1377b9f24eb65c7299312be758db1
Gerrit-Change-Number: 1156316
Gerrit-PatchSet: 2
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]

Reply via email to