jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Skip Token tests if user doesn't have rights" ......................................................................
Revert "Skip Token tests if user doesn't have rights"
As TokenWallet.__getitem__ has side effects and caches the token if needed, a 'in' only checks if the token has been cached (see also the docstring of TokenWallet.__contains__).
A test done before merging this has been able to execute 'test_token' ( https://travis-ci.org/wikimedia/pywikibot-core/jobs/45416313#L801 ) while a test with this merged in has skipped it ( https://travis-ci.org/wikimedia/pywikibot-core/jobs/45420743#L800 ).
This reverts commit affc77a480653aba1631b3c38cc5376390730579.
Change-Id: Ia229b6473b075dd3e8a17a48f9d054d0ec0977bc --- M tests/site_tests.py 1 file changed, 0 insertions(+), 16 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index fa138bd..60bb7bb 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -53,10 +53,6 @@ mysite = self.get_site() mainpage = self.get_mainpage() ttype = "edit" - if ttype not in mysite.tokens: - raise unittest.SkipTest( - "Action '%s' not allowed for user %s on wiki %s" - % (ttype, mysite.user(), mysite)) try: token = mysite.tokens[ttype] except KeyError: @@ -1164,11 +1160,6 @@ """Test the site.patrol() method.""" mysite = self.get_site()
- if 'patrol' not in mysite.tokens: - raise unittest.SkipTest( - "Action patrol is not allowed for user {0} on wiki {1}" - .format(mysite.user(), mysite)) - rc = list(mysite.recentchanges(total=1))[0]
# site.patrol() needs params @@ -1262,14 +1253,7 @@ raise unittest.SkipTest( u'Site %s version %s is too low for this tests.' % (self.mysite, self._version)) - - if in_tested not in self.mysite.tokens: - raise unittest.SkipTest( - 'Action %s is not allowed for user %s on wiki %s.' - % (in_tested, self.mysite.user(), self.mysite)) - self.mysite.version = lambda: test_version - for ttype in ("edit", "move", additional_token): try: token = self.mysite.tokens[ttype]
pywikibot-commits@lists.wikimedia.org