jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Pagegen test: Allow same chars anywhere ......................................................................
[FIX] Pagegen test: Allow same chars anywhere
The test_regexfilter_default test requires that a page begins with the same character at least twice. This is obviously not possible on wikidata because all main namespace pages begin with Q and a digit which are never the same. Thus the test never ends because it can't find 10 pages. This removes the requirement that the first two chracters need to be the same, although this could still cause freezes if a wiki is very small and doesn't contain 10 pages which have at least the same character twice.
Those tests aren't executed by travis with wikidata configured so it doesn't happen there currently.
Change-Id: I312334bc202894c7eb224c5f46ec32b725c2c961 --- M tests/pagegenerators_tests.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py index b11432f..7ffe7a1 100755 --- a/tests/pagegenerators_tests.py +++ b/tests/pagegenerators_tests.py @@ -471,15 +471,15 @@
def test_regexfilter_default(self): gf = pagegenerators.GeneratorFactory() - # Matches titles with the same two or more starting letters - self.assertTrue(gf.handleArg('-titleregex:^(.)\1+')) + # Matches titles with the same two or more continous characters + self.assertTrue(gf.handleArg('-titleregex:(.)\1+')) gf.handleArg('-limit:10') gen = gf.getCombinedGenerator() pages = list(gen) self.assertLessEqual(len(pages), 10) for page in pages: self.assertIsInstance(page, pywikibot.Page) - self.assertRegex(page.title().lower(), '^(.)\1+') + self.assertRegex(page.title().lower(), '(.)\1+')
def test_regexfilter_ns(self): raise unittest.SkipTest('This test takes over 10 minutes due to T85389')
pywikibot-commits@lists.wikimedia.org