Page MenuHomePhabricator

pagegen test problems
Closed, ResolvedPublic

Description

With site set to ar.wikt (irrelevant for some of these errors..) and master at commit f993098f13e4db5acb89bec639c9d07d59e88a57

$ python -m unittest tests.pagegenerators_tests
...
======================================================================
ERROR: test_intersect_newpages_csd (tests.pagegenerators_tests.EnglishWikipediaPageGeneratorIntersectTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/pagegenerators_tests.py", line 813, in test_intersect_newpages_csd
    site, 'Category:Candidates_for_speedy_deletion'))]
  File "tests/thread_tests.py", line 51, in assertEqualItertools
    result = list(intersect_generators(datasets))
  File "pywikibot/tools/__init__.py", line 548, in intersect_generators
    threaded_gen = ThreadedGenerator(name=repr(source), target=source)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 6-7: ordinal not in range(128)

======================================================================
ERROR: test_intersect_newpages_and_recentchanges (tests.pagegenerators_tests.PageGeneratorIntersectTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/pagegenerators_tests.py", line 797, in test_intersect_newpages_and_recentchanges
    pagegenerators.RecentChangesPageGenerator(site=site, total=200)])
  File "tests/thread_tests.py", line 51, in assertEqualItertools
    result = list(intersect_generators(datasets))
  File "pywikibot/tools/__init__.py", line 548, in intersect_generators
    threaded_gen = ThreadedGenerator(name=repr(source), target=source)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)

======================================================================
ERROR: test_intersect_newpages_twice (tests.pagegenerators_tests.PageGeneratorIntersectTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/pagegenerators_tests.py", line 791, in test_intersect_newpages_twice
    pagegenerators.NewpagesPageGenerator(site=site, total=10)])
  File "tests/thread_tests.py", line 51, in assertEqualItertools
    result = list(intersect_generators(datasets))
  File "pywikibot/tools/__init__.py", line 548, in intersect_generators
    threaded_gen = ThreadedGenerator(name=repr(source), target=source)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)

======================================================================
FAIL: test_brackets (tests.pagegenerators_tests.TestTextfilePageGenerator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/pagegenerators_tests.py", line 276, in test_brackets
    self.assertPagelistTitles(titles, self.expected_titles[site.case()])
  File "tests/aspects.py", line 216, in assertPageTitlesEqual
    self.assertEqual(gen_titles, titles)
AssertionError: Lists differ: [u'File', u'Bracket', u'MediaW... != [u'file', u'bracket', u'MediaW...

First differing element 0:
File
file

- [u'File', u'Bracket', u'MediaWiki:Test', u'Under score', u'Upper case']
?    ^        ^                              ^

+ [u'file', u'bracket', u'MediaWiki:Test', u'under score', u'Upper case']
?    ^        ^                              ^


======================================================================
FAIL: test_lines (tests.pagegenerators_tests.TestTextfilePageGenerator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/pagegenerators_tests.py", line 282, in test_lines
    self.assertPagelistTitles(titles, self.expected_titles[site.case()])
  File "tests/aspects.py", line 216, in assertPageTitlesEqual
    self.assertEqual(gen_titles, titles)
AssertionError: Lists differ: [u'File', u'Bracket', u'MediaW... != [u'file', u'bracket', u'MediaW...

First differing element 0:
File
file

- [u'File', u'Bracket', u'MediaWiki:Test', u'Under score', u'Upper case']
?    ^        ^                              ^

+ [u'file', u'bracket', u'MediaWiki:Test', u'under score', u'Upper case']
?    ^        ^                              ^


----------------------------------------------------------------------
Ran 53 tests in 101.278s

FAILED (failures=2, errors=3, skipped=2, expected failures=1)

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb added projects: Pywikibot, Pywikibot-tests.
jayvdb subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptApr 8 2015, 10:48 PM
jayvdb set Security to None.

Change 203034 had a related patch set uploaded (by John Vandenberg):
Set DrySite Wiktionary case='case-sensitive'

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

Change 203051 had a related patch set uploaded (by XZise):
[FIX] Use str for repr in both Python versions

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

Change 203034 merged by jenkins-bot:
Set DrySite Wiktionary case='case-sensitive'

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

jayvdb claimed this task.

The test problems are resolved, and I believe the underlying bugs have also been fixed.

Change 203051 abandoned by XZise:
[FIX] Use str for repr in both Python versions

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