jenkins-bot has submitted this change and it was merged.
Change subject: Make get_test_unconnected_page more robust ......................................................................
Make get_test_unconnected_page more robust
Travis tests are regularly 'red' due to bug 67956. This changeset should reduce the frequency of this problem by fetching Talk: pages which should be valid for wikibase items, but also check 10 of them and return the first without a wikibase item.
Change-Id: I8df00fb9d492e0d400360031c6088bf4a2f2cf4a --- M tests/wikibase_tests.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index ba91af6..72381fb 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -27,8 +27,11 @@ # fetch a page which is very likely to be unconnected, which doesnt have # a generator, and unit tests may be used to test old versions of pywikibot def get_test_unconnected_page(site): - gen = pagegenerators.NewpagesPageGenerator(site=site, total=1) - return next(gen) + gen = pagegenerators.NewpagesPageGenerator(site=site, total=10, + namespaces=[1, ]) + for page in gen: + if not page.properties().get('wikibase_item'): + return page
class TestGeneral(PywikibotTestCase):
pywikibot-commits@lists.wikimedia.org