Page MenuHomePhabricator

Unexpected success with TestGenerateFamilyFiles.test_attributes_after_run
Closed, ResolvedPublic

Description

=================================== FAILURES ===================================
______________ TestGenerateFamilyFiles.test_attributes_after_run _______________
Unexpected success

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript

Change 538383 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [tests] use subTest to detect failing tests more specific

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

Removing the expectedFailure decorator and enabling subTest we can find two sorts of failures:

  1. Assertion Error reported in T194138
  2. SiteDefinitionError reported in T233487

Change 538383 merged by jenkins-bot:
[pywikibot/core@master] [tests] use subTest to detect failing tests more specific

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

Change 548768 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [tests] Use allowed_failure with Python 2 behaviour

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

Change 548768 merged by jenkins-bot:
[pywikibot/core@master] [tests] Use allowed_failure with Python 2 behaviour

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

Currently throws an error in some Travis environments:

ERROR: test_attributes_after_run (tests.generate_family_files_tests.TestGenerateFamilyFiles)

Test FamilyFileGenerator attributes after run().

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/build/wikimedia/pywikibot/tests/utils.py", line 93, in wrapper

    func(*args, **kwargs)

  File "/home/travis/build/wikimedia/pywikibot/tests/generate_family_files_tests.py", line 65, in test_attributes_after_run

    site = Site(url=lang['url'])

  File "/home/travis/build/wikimedia/pywikibot/pywikibot/__init__.py", line 1229, in Site

    code, fam = _code_fam_from_url(url)

  File "/home/travis/build/wikimedia/pywikibot/pywikibot/__init__.py", line 1186, in _code_fam_from_url

    raise SiteDefinitionError("Unknown URL '{0}'.".format(url))

pywikibot.exceptions.SiteDefinitionError: Unknown URL 'https://gd.wikisource.org/wiki/$1'.

And sometimes there is an unexpected success in some AppVeyor environments.

Currently throws an error in some Travis environments:

I think all of these SiteDefinitionError come from wikisource interwikimap. There are a lot of urls which does not exist but redirects to https://wikisource.org/wiki/Main_Page

I created a new task T241413 for this issue