Page MenuHomePhabricator

Skip TestValidTemplate gracefully if i18n package is missing
Closed, ResolvedPublic

Description

Currently the test raises an exception instead of skipping as assumed

C:\pwb\GIT\core>py -3 pwb.py l10n_tests -v TestValidTemplate
tests: max_retries reduced from 15 to 1
Traceback (most recent call last):
  File "pwb.py", line 297, in <module>
    if not main():
  File "pwb.py", line 292, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 96, in run_python_file
    main_mod.__dict__)
  File ".\tests\l10n_tests.py", line 86, in <module>
    class TestValidTemplate(TestCase):
  File "C:\pwb\GIT\core\tests\utils.py", line 118, in add_metaclass
    return six.add_metaclass(cls.__metaclass__)(cls)
  File "C:\python37\lib\site-packages\six.py", line 847, in wrapper
    return metaclass(cls.__name__, cls.__bases__, orig_vars)
  File ".\tests\l10n_tests.py", line 66, in __new__
    .format(i18n._messages_package_name))
unittest.case.SkipTest: i18n messages package 'scripts.i18n' not available.
CRITICAL: Exiting due to uncaught exception <class 'unittest.case.SkipTest'>

C:\pwb\GIT\core>

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt triaged this task as Lowest priority.Jun 12 2019, 2:47 PM

Change 516638 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [tests] Skip test gracefully if i18n package is missing

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

Change 516638 merged by jenkins-bot:
[pywikibot/core@master] [tests] Skip test gracefully if i18n package is missing

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