Xqt created this task.
Xqt added a project: Pywikibot-tests.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
Restricted Application added a project: Pywikibot.

TASK DESCRIPTION
  test_access_denied_notexist_username method of TestLazyLoginNotExistUsername 
in api_tests fails since few day. Looks like an api change:
  
    =================================== FAILURES 
===================================
    ______ TestLazyLoginNotExistUsername.test_access_denied_notexist_username 
______
    
    self = <tests.api_tests.TestLazyLoginNotExistUsername 
testMethod=test_access_denied_notexist_username>
    error = <MagicMock name='error' id='140283843833360'>
    warning = <MagicMock name='warning' id='140283843871800'>
    exception = <MagicMock name='exception' id='140283843824440'>
    output = <MagicMock name='output' id='140283843895192'>
    
        @suppress_warnings('pywikibot.family.Family.version is deprecated')
        @patch.object(pywikibot, 'output')
        @patch.object(pywikibot, 'exception')
        @patch.object(pywikibot, 'warning')
        @patch.object(pywikibot, 'error')
        def test_access_denied_notexist_username(
            self, error, warning, exception, output
        ):
            """Test the query with a username which does not exist."""
            self.site._username = ['Not registered username', None]
            req = api.Request(site=self.site, parameters={'action': 'query'})
            self.assertRaises(pywikibot.NoUsername, req.submit)
            # FIXME: T100965
            self.assertRaises(api.APIError, req.submit)
    >       error.assert_called_with('Login failed (Failed).')
    
    tests/api_tests.py:1025: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
    
    _mock_self = <MagicMock name='error' id='140283843833360'>
    args = ('Login failed (Failed).',), kwargs = {}
    expected = (('Login failed (Failed).',), {})
    _error_message = <function 
NonCallableMock.assert_called_with.<locals>._error_message at 0x7f9660b1ebf8>
    actual = call('Login failed (readapidenied).'), cause = None
    
        def assert_called_with(_mock_self, *args, **kwargs):
            """assert that the mock was called with the specified arguments.
        
            Raises an AssertionError if the args and keyword args passed in are
            different to the last call to the mock."""
            self = _mock_self
            if self.call_args is None:
                expected = self._format_mock_call_signature(args, kwargs)
                raise AssertionError('Expected call: %s\nNot called' % 
(expected,))
        
            def _error_message():
                msg = self._format_mock_failure_message(args, kwargs)
                return msg
            expected = self._call_matcher((args, kwargs))
            actual = self._call_matcher(self.call_args)
            if expected != actual:
                cause = expected if isinstance(expected, Exception) else None
    >           raise AssertionError(_error_message()) from cause
    E           AssertionError: Expected call: error('Login failed (Failed).')
    E           Actual call: error('Login failed (readapidenied).')
    
    /opt/python/3.5.6/lib/python3.5/unittest/mock.py:794: AssertionError
    ------------------------------ Captured log call 
-------------------------------
    logging.py                 109 VERBOSE  Found 1 steward:steward processes 
running, including this one.
    logging.py                 109 VERBOSE  API Error: query=
    ("{'continue': [True], 'action': ['query'], 'siprop': ['namespaces', "
     "'namespacealiases', 'general'], 'maxlag': ['5'], 'uiprop': ['blockinfo', "
     "'hasmsg'], 'format': ['json'], 'meta': ['siteinfo', 'userinfo']}")
    logging.py                 109 VERBOSE             response=
    {'error': {'code': 'readapidenied', 'help': 'See 
https://steward.wikimedia.org/w/api.php for API usage. Subscribe to the 
mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.', 'info': 'You need read 
permission to use this module.'}, 'servedby': 'mw1290'}
    logging.py                 109 VERBOSE  API Error: query=
    ("{'action': ['query'], 'rawcontinue': [''], 'maxlag': ['5'], 'uiprop': "
     "['blockinfo', 'groups', 'hasmsg', 'rights'], 'format': ['json'], 'meta': "
     "['userinfo']}")
    logging.py                 109 VERBOSE             response=
    {'error': {'code': 'readapidenied', 'help': 'See 
https://steward.wikimedia.org/w/api.php for API usage. Subscribe to the 
mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.', 'info': 'You need read 
permission to use this module.'}, 'servedby': 'mw1346'}
    logging.py                 109 VERBOSE  API Error: query=
    ("{'action': ['query'], 'rawcontinue': [''], 'maxlag': ['5'], 'type': "
     "['login'], 'format': ['json'], 'meta': ['tokens']}")
    logging.py                 109 VERBOSE             response=
    {'error': {'code': 'readapidenied', 'help': 'See 
https://steward.wikimedia.org/w/api.php for API usage. Subscribe to the 
mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.', 'info': 'You need read 
permission to use this module.'}, 'servedby': 'mw1344'}
    logging.py                 109 VERBOSE  API Error: query=
    ("{'action': ['query'], 'rawcontinue': [''], 'maxlag': ['5'], 'uiprop': "
     "['blockinfo', 'hasmsg'], 'format': ['json'], 'meta': ['userinfo']}")
    logging.py                 109 VERBOSE             response=
    {'error': {'code': 'readapidenied', 'help': 'See 
https://steward.wikimedia.org/w/api.php for API usage. Subscribe to the 
mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.', 'info': 'You need read 
permission to use this module.'}, 'servedby': 'mw1340'}
    =============================== warnings summary 
===============================
  
  https://api.travis-ci.org/v3/job/558251441/log.txt

TASK DETAIL
  https://phabricator.wikimedia.org/T227951

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Aklapper, pywikibot-bugs-list, Dalba, Xqt, Viztor, DannyS712, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to