jenkins-bot has submitted this change and it was merged.
Change subject: Remove site.randompages() continuation uniqueness test ......................................................................
Remove site.randompages() continuation uniqueness test
Uniqueness is not guaranteed by the API, and thus should not be guaranteed on the site api level.
Bug: T84944 Change-Id: I5a9a8c6d056f0d23fa300a8ed462d8673218241d --- M tests/site_tests.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index d0f85d5..b4ecfd4 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -1323,12 +1323,15 @@ """Test random methods of a site."""
def test_unlimited_small_step(self): - """Test site.randompages() without limit.""" + """Test site.randompages() continuation. + + Note that uniqueness is not guaranteed if multiple requests are + performed, so we also don't test this here. + """ mysite = self.get_site() pages = [] for rndpage in mysite.randompages(step=5, total=None): self.assertIsInstance(rndpage, pywikibot.Page) - self.assertNotIn(rndpage, pages) pages.append(rndpage) if len(pages) == 11: break
pywikibot-commits@lists.wikimedia.org