Page MenuHomePhabricator

test_logevents is failing on Travis
Closed, DuplicatePublic

Description

_________________________ TestLogEvents.test_logevents _________________________
self = <tests.site_tests.TestLogEvents testMethod=test_logevents>
    def test_logevents(self):
        """Test logevents method."""
        mysite = self.get_site()
        le = list(mysite.logevents(total=10))
        self.assertLessEqual(len(le), 10)
        self.assertTrue(all(isinstance(entry, pywikibot.logentries.LogEntry)
                            for entry in le))
        for typ in ("block", "protect", "rights", "delete", "upload",
                    "move", "import", "patrol", "merge"):
>           for entry in mysite.logevents(logtype=typ, total=3):
tests/site_tests.py:1100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pywikibot/data/api.py:2791: in __iter__
    yield self.result(item)
pywikibot/data/api.py:3003: in result
    return self.entryFactory.create(pagedata)
pywikibot/logentries.py:421: in create
    return self._creator(logdata)
pywikibot/logentries.py:404: in <lambda>
    self._creator = lambda data: logclass(data, self._site)
pywikibot/logentries.py:148: in __init__
    pos = self.data['title'].find('#')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = {u'comment': u'', u'timestamp': u'2016-08-24T05:49:02Z', u'logid': 106601, u'u...pe': u'block', u'action': u'unblock', u'actionhidden': u'', u'suppressed': u''}
key = 'title'
    def __missing__(self, key):
        """Debug when the key is missing."""
        pywikibot.debug(u"API log entry received:\n" + repr(self),
                        _logger)
>       raise KeyError("Log entry (%s) has no '%s' key" % (self._type, key))
E       KeyError: u"Log entry (block) has no 'title' key"

see: https://travis-ci.org/wikimedia/pywikibot-core/jobs/177955830#L1700-L1739

Related Objects

Event Timeline

log that causes the problem:

{'timestamp': '2016-08-24T05:49:02Z', 'actionhidden': '', 'logid': 106601, 'user': 'Glaisher', 'action': 'unblock', 'comment': '', 'type': 'block', 'suppressed': ''}

see: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special%3ALog&type=&user=Glaisher&page=&year=&month=-1&tagfilter=&hide_thanks_log=1&hide_tag_log=1&hide_review_log=1