Page MenuHomePhabricator

TestFilePageDataItem.test_data_item_when_file_exist_but_without_item of file_tests fails recently
Closed, ResolvedPublicBUG REPORT

Description

Test was introduced with rPWBC92ad39a due to T348422 months ago but now it fails. Seems there are no pages found without 'mediainfo' wohtin the first 5 pages

D:\pwb\GIT\core>py -3.11 -m pwb -site:commons file_tests -v TestFilePageDataItem.test_data_item_when_file_exist_but_without_item
tests: max_retries reduced from 15 to 3
test_data_item_when_file_exist_but_without_item (__main__.TestFilePageDataItem.test_data_item_when_file_exist_but_without_item)
Test if data item is missing from file. ... ERROR

======================================================================
ERROR: test_data_item_when_file_exist_but_without_item (__main__.TestFilePageDataItem.test_data_item_when_file_exist_but_without_item)
Test if data item is missing from file.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\pwb\GIT\core\tests\file_tests.py", line 429, in test_data_item_when_file_exist_but_without_item
    item = page.data_item()
           ^^^^
UnboundLocalError: cannot access local variable 'page' where it is not associated with a value

----------------------------------------------------------------------
Ran 1 test in 3.059s

FAILED (errors=1)

Event Timeline

Xqt triaged this task as High priority.Mon, Jun 17, 3:51 PM
Xqt changed the subtype of this task from "Task" to "Bug Report".
Xqt changed the task status from Open to In Progress.Tue, Jun 18, 1:11 PM
Xqt claimed this task.

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

[pywikibot/core@master] [IMPR] ignore ValueError durig upcast of FilePage due to invalid file extension

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

Change #1047079 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] ignore ValueError durig upcast of FilePage due to invalid file extension

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