jayvdb added a comment.
I've narrowed it down on ar.wp to:
```
PYSETUP_TEST_EXTRAS=1 python -m unittest -v tests.site_tests tests.link_tests
tests.interwiki_link_tests tests.page_tests
...
test_watch (tests.page_tests.TestPageUserAction) ... WARNING: API warning (watch): The
title parameter has been deprecated.
ERROR: APIError: badtoken: Invalid token
Traceback (most recent call last):
File "tests/utils.py", line 54, in wrapper
func(*args, **kwargs)
File "tests/page_tests.py", line 610, in test_watch
rv = userpage.watch()
File "pywikibot/page.py", line 1113, in watch
return self.site.watchpage(self, unwatch)
File "pywikibot/site.py", line 4353, in watchpage
result = req.submit()
File "pywikibot/data/api.py", line 1071, in submit
raise APIError(code, info, **result["error"])
APIError: badtoken: Invalid tokenskipped ''
```
Note that just running site_tests page_tests does not cause this bug.
TASK DETAIL
https://phabricator.wikimedia.org/T77965
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign
<username>.
To: jayvdb
Cc: Aklapper, jayvdb, pywikipedia-bugs