List of steps to reproduce (step by step, including full links if applicable):
Run pwb pagegenerators_tests -v PetScanPageGeneratorTestCase.test_petscan
What happens?:
======================================================================
ERROR: test_petscan (__main__.PetScanPageGeneratorTestCase)
Test PetScanPageGenerator.
----------------------------------------------------------------------
Traceback (most recent call last):
File ".\tests\pagegenerators_tests.py", line 376, in test_petscan
self.assertPageTitlesEqual(gen, titles=(
File "D:\pwb\GIT\core\tests\aspects.py", line 246, in assertPageTitlesEqual
gen_titles = self._get_gen_titles(gen, len(titles), site)
File "D:\pwb\GIT\core\tests\aspects.py", line 180, in _get_gen_titles
gen_pages = self._get_gen_pages(gen, count, site)
File "D:\pwb\GIT\core\tests\aspects.py", line 163, in _get_gen_pages
gen_pages = list(gen)
File "D:\pwb\GIT\core\pywikibot\pagegenerators.py", line 3087, in __iter__
for raw_page in self.query():
File "D:\pwb\GIT\core\pywikibot\pagegenerators.py", line 3083, in query
raw_pages = j['*'][0]['a']['*']
KeyError: '*'
----------------------------------------------------------------------
Ran 1 test in 2.933s
FAILED (errors=1)What should have happened instead?:
Instead of a unspecific KeyError an Error should be raised with additional informations. The json result contains an error in such case like
{'error': 'No result for source categories'} .
Software version:
Pywikibot 3+