jenkins-bot has submitted this change and it was merged.
Change subject: Script test fixes for py2.6 ......................................................................
Script test fixes for py2.6
unittest2 on py2.6 on travis reports the following warning and returns a non-zero exit code for the test suite when a test is unexpectedly successful.
DeprecationWarning: Use of a TestResult without an addUnexpectedSuccess method is deprecated
Several of our tests fail only on one site (en.wp, ar.wp or wd), or on other conditions which cant be predicted.
This test removes use of unexpected success from the tests.
Change-Id: Ic2a4be02871f9eda2c40744935392985cd7a6a01 --- M tests/script_tests.py 1 file changed, 7 insertions(+), 6 deletions(-)
Approvals: John Vandenberg: Verified; Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py index 038653e..a6a9398 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -12,6 +12,7 @@ import time import subprocess import pywikibot +from pywikibot import config from tests.utils import unittest, PywikibotTestCase
@@ -53,6 +54,8 @@ and not name.startswith('_') # skip __init__.py and _* and check_script_deps(name) and name != 'imageuncat.py' # this halts indefinitely + and name != 'watchlist.py' # result depends on speed + and name != 'script_wui.py' # depends on lua compiling ] return script_list
@@ -205,7 +208,6 @@ no_args_expected_results) if script_name in ['add_text', # raises custom NoEnoughData 'checkimages', # bug 68613 - 'cfd', # bug 69015 'commonscat', # raises custom NoEnoughData 'claimit', # bug 68657 - zero output 'data_ingestion', # bug 68611 @@ -214,15 +216,14 @@ 'flickrripper', # bug 68606 (and deps) 'imagerecat', # bug 68658 'imagetransfer', # bug 68659 - 'lonelypages', # raises custom Exception - 'misspelling', # bug 68665 'pagefromfile', # bug 68660 - 'script_wui', # bug 68797 'template', # bug 68661 - zero output 'transferbot', # raises custom Exception 'upload', # raises custom ValueError - 'watchlist', # fails on Wikidata only - ]: + ] or \ + (config.family == 'wikidata' and script_name == 'lonelypages') or \ + ((config.family != 'wikipedia' or config.mylang != 'en') and script_name == 'cfd') or \ + (config.family == 'wikipedia' and config.mylang != 'en' and script_name == 'misspelling'): dct[test_name] = unittest.expectedFailure(dct[test_name]) dct[test_name].__doc__ = \ 'Test running ' + script_name + ' without arguments.'
pywikibot-commits@lists.wikimedia.org