jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/854548 )
Change subject: [test] Fix User.usercontribs test ......................................................................
[test] Fix User.usercontribs test
Change-Id: I74b74ceaa6066548ad7a5eb413bc21741703b22b --- M tests/user_tests.py 1 file changed, 4 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/user_tests.py b/tests/user_tests.py index 0488dca..81c8443 100755 --- a/tests/user_tests.py +++ b/tests/user_tests.py @@ -173,15 +173,16 @@
def test_contribution(self): """Test the User.usercontribs() method.""" + total = 50 mysite = self.get_site() user = User(mysite, mysite.user()) - uc = list(user.contributions(total=50)) + uc = list(user.contributions(total=total)) if not uc: self.skipTest('User {} has no contributions on site {}.' .format(mysite.user(), mysite)) - self.assertLessEqual(len(uc), 10) + self.assertLessEqual(len(uc), total) self.assertEqual(uc[0], user.last_edit) - first_edit = uc[-1] if len(uc) < 50 else list( + first_edit = uc[-1] if len(uc) < total else list( user.contributions(total=1, reverse=True))[0] self.assertEqual(first_edit, user.first_edit) for contrib in uc:
pywikibot-commits@lists.wikimedia.org