Page MenuHomePhabricator

logentries_tests fails in TestLogentryParams.test_move_entry_tewp
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

pwb logentries_tests -v TestLogentryParams.test_move_entry_tewp

What happens?:

D:\pwb\GIT\core>py -3.11 pwb.py logentries_tests -v TestLogentryParams.test_move_entry_tewp
tests: max_retries reduced from 15 to 1
test_move_entry_tewp (__main__.TestLogentryParams.test_move_entry_tewp)
Test MoveEntry methods on wikipedia:test ... ERROR

======================================================================
ERROR: test_move_entry_tewp (__main__.TestLogentryParams.test_move_entry_tewp)
Test MoveEntry methods on wikipedia:test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\pwb\GIT\core\tests\aspects.py", line 701, in wrapped_method
    func(self, key)
  File "D:\pwb\GIT\core\tests\logentries_tests.py", line 222, in test_move_entry
    self.assertIsInstance(logentry.target_ns, pywikibot.site.Namespace)
                          ^^^^^^^^^^^^^^^^^^
  File "D:\pwb\GIT\core\pywikibot\logentries.py", line 255, in target_ns
    return self.site.namespaces[self._params['target_ns']]
                                ~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'target_ns'

----------------------------------------------------------------------
Ran 1 test in 2.534s

FAILED (errors=1)

Other information (browser name/version, screenshots, etc.):
This is due to a hidden log entry: https://test.wikipedia.org/w/index.php?title=Special%3ALog&logid=359963
see https://gerrit.wikimedia.org/r/c/pywikibot/core/+/908037

Event Timeline

Xqt triaged this task as High priority.Apr 13 2023, 1:36 PM
Xqt added a subscriber: Meno25.
Xqt changed the task status from Open to In Progress.Apr 13 2023, 1:49 PM
Xqt claimed this task.

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

[pywikibot/core@master] [tests] Skip test_move_entry test if log entry action is hidden

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

Change 908550 merged by Xqt:

[pywikibot/core@master] [tests] Skip test_move_entry test if log entry action is hidden

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