TestLazyLoginNotExistUsername and TestLazyLoginNoUsername are failing. The reason is that read api permission is required since few hours. For example:
https://steward.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases|general&continue=&format=jsonfm
gives an error "code": "readapidenied" but unfortunately this error is not recognized when retrieving site info. The request above gives an empty dict.
This occures after rPWBC6761f988
The error is ignored by api.submit due to pywikibot.site.LoginStatus.IN_PROGRESS but not handled accordingly by LoginManager
C:\pwb\GIT\core>py -3 pwb.py api_tests -v TestLazyLoginNotExistUsername tests: max_retries reduced from 15 to 1 test_access_denied_notexist_username (__main__.TestLazyLoginNotExistUsername) Test the query with a username which does not exist. ... steward:steward /w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases|general&continue= {} ERROR ====================================================================== ERROR: test_access_denied_notexist_username (__main__.TestLazyLoginNotExistUsername) Test the query with a username which does not exist. ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\pwb\GIT\core\pywikibot\tools\__init__.py", line 525, in suppressed_func return func(*args, **kwargs) File "C:\Python38\lib\unittest\mock.py", line 1342, in patched return func(*newargs, **newkeywargs) File ".\tests\api_tests.py", line 1023, in test_access_denied_notexist_username self.assertRaises(pywikibot.NoUsername, req.submit) File "C:\Python38\lib\unittest\case.py", line 816, in assertRaises return context.handle('assertRaises', args, kwargs) File "C:\Python38\lib\unittest\case.py", line 202, in handle callable_obj(*args, **kwargs) File "C:\pwb\GIT\core\pywikibot\data\api.py", line 1938, in submit self._add_defaults() File "C:\pwb\GIT\core\pywikibot\data\api.py", line 1479, in _add_defaults and self.site.mw_version >= '1.25wmf5'): File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 2778, in mw_version mw_ver = MediaWikiVersion(self.version()) File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 2750, in version version = self.siteinfo.get('generator', File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 1690, in get preloaded = self._get_general(key, expiry) File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 1638, in _get_general self._cache[prop] = default_info[prop] KeyError: 'namespaces' ---------------------------------------------------------------------- Ran 1 test in 0.512s FAILED (errors=1)
C:\pwb\GIT\core>py -3 pwb.py api_tests -v TestLazyLoginNoUsername tests: max_retries reduced from 15 to 1 test_access_denied_no_username (__main__.TestLazyLoginNoUsername) Test the query without a username. ... steward:steward /w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases|general&continue= {} ERROR ====================================================================== ERROR: test_access_denied_no_username (__main__.TestLazyLoginNoUsername) Test the query without a username. ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\pwb\GIT\core\pywikibot\tools\__init__.py", line 525, in suppressed_func return func(*args, **kwargs) File "C:\Python38\lib\unittest\mock.py", line 1342, in patched return func(*newargs, **newkeywargs) File ".\tests\api_tests.py", line 1052, in test_access_denied_no_username self.assertRaises(pywikibot.NoUsername, req.submit) File "C:\Python38\lib\unittest\case.py", line 816, in assertRaises return context.handle('assertRaises', args, kwargs) File "C:\Python38\lib\unittest\case.py", line 202, in handle callable_obj(*args, **kwargs) File "C:\pwb\GIT\core\pywikibot\data\api.py", line 1938, in submit self._add_defaults() File "C:\pwb\GIT\core\pywikibot\data\api.py", line 1479, in _add_defaults and self.site.mw_version >= '1.25wmf5'): File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 2778, in mw_version mw_ver = MediaWikiVersion(self.version()) File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 2750, in version version = self.siteinfo.get('generator', File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 1690, in get preloaded = self._get_general(key, expiry) File "C:\pwb\GIT\core\pywikibot\site\__init__.py", line 1638, in _get_general self._cache[prop] = default_info[prop] KeyError: 'namespaces' ---------------------------------------------------------------------- Ran 1 test in 0.518s FAILED (errors=1)