Page MenuHomePhabricator

pagegenerators_test.TestFactoryGeneratorWikibase is failing
Closed, ResolvedPublic

Description

======================================================================
FAIL: test_onlyif (__main__.TestFactoryGeneratorWikibase)
Test -onlyif without qualifiers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "...pywikibot-core/tests/pagegenerators_tests.py", line 1192, in test_onlyif
    self.assertEqual(len(set(gen)), 1)
AssertionError: 0 != 1

======================================================================
FAIL: test_onlyif_qualifiers (__main__.TestFactoryGeneratorWikibase)
Test -onlyif with qualifiers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "...pywikibot-core/tests/pagegenerators_tests.py", line 1211, in test_onlyif_qualifiers
    self.assertEqual(len(set(gen)), 1)
AssertionError: 0 != 1

======================================================================
FAIL: test_onlyifnot (__main__.TestFactoryGeneratorWikibase)
Test -onlyifnot without qualifiers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "...pywikibot-core/tests/pagegenerators_tests.py", line 1202, in test_onlyifnot
    self.assertEqual(len(set(gen)), 0)
AssertionError: 1 != 0

https://travis-ci.org/wikimedia/pywikibot-core/jobs/272455787#L4396

Event Timeline

Dalba triaged this task as High priority.Sep 6 2017, 12:36 PM
Dalba updated the task description. (Show Details)
Dalba renamed this task from pagegenerators_test.TestFactoryGeneratorWikibase is failoing to pagegenerators_test.TestFactoryGeneratorWikibase is failing.Sep 6 2017, 12:43 PM

Restoring dupfiltergen = PreloadingItemGenerator(dupfiltergen) which was removed in 06bf3e0d5a16fde067df11bfd5a94633fb88f30f fixes the issue for me.

I think the problem is that objects returned from -page:Q12345 (or most other generators) are Pages, not ItemPages. PreloadingItemGenerator could handle that but I had to remove it because it only works with ItemPages (which blocked the patch).

In long-term, subtasks of T160395 should be solved. For now I will try to use some logic from the mentioned generator.

Change 376278 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[pywikibot/core@master] [Bugfix] Deal with fake entities in ItemClaimFilter

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

Change 376278 merged by jenkins-bot:
[pywikibot/core@master] [Bugfix] Deal with fake entities in ItemClaimFilter

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