Page MenuHomePhabricator

test_citoid_positive method of citoid_tests.TestCitoid fails
Closed, ResolvedPublicBUG REPORT

Description

C:\pwb\GIT\core>py -3.13 -m pwb citoid_tests
tests: max_retries reduced from 15 to 3
..{'error': 'Unable to load URL https://ro.wikipedia.org/wiki/Rom%C3%A2nia'}
E 10.291s
======================================================================
ERROR: test_citoid_positive (__main__.TestCitoid.test_citoid_positive)
Test citoid script.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\citoid_tests.py", line 36, in test_citoid_positive
    self.assertEqual(resp[0]['title'], 'România')
                     ~~~~^^^
KeyError: 0

----------------------------------------------------------------------
Ran 3 tests in 11.720s

FAILED (errors=1)

The result dict is {'error': 'Unable to load URL https://ro.wikipedia.org/wiki/Rom%C3%A2nia'} and an exception should be raised in such case instead passing silently and have a KeyError within tests.

Details

Related Changes in Gerrit:

Event Timeline

Xqt triaged this task as High priority.Jul 27 2026, 10:04 AM
Xqt moved this task from Backlog to CI test failures on the Pywikibot-tests board.
Xqt updated the task description. (Show Details)

Change #1318204 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] citoid: raise CitoidError on error response

https://gerrit.wikimedia.org/r/1318204

Xqt changed the task status from Open to In Progress.Jul 27 2026, 5:23 PM
Xqt claimed this task.
Xqt moved this task from Backlog to Needs Review on the Pywikibot board.

Change #1318204 merged by jenkins-bot:

[pywikibot/core@master] citoid: raise CitoidError on error response

https://gerrit.wikimedia.org/r/1318204