jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/761936 )
Change subject: [tests] skip test_speedy_delete if no user is logged in ......................................................................
[tests] skip test_speedy_delete if no user is logged in
Bug: T301555 Change-Id: Ia478ee1a4f81f5481fcba74ed37e27d7480440c6 --- M tests/script_tests.py 1 file changed, 12 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py index fa02e3e..baa8aab 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -122,6 +122,11 @@ 'upload': 'ERROR: Upload error', }
+# skip test if result is unexpected in this way +skip_on_results = { + 'speedy_delete': 'No user is logged in on site' # T301555 +} +
enable_autorun_tests = ( os.environ.get('PYWIKIBOT_TEST_AUTORUN', '0') == '1') @@ -234,8 +239,12 @@ if result['exit_code'] == -9: unittest_print(' killed', end=' ')
+ skip_result = self._skip_results.get(script_name) + if skip_result and skip_result in err_result: + self.skipTest(skip_result) + if error: - self.assertIn(error, result['stderr']) + self.assertIn(error, err_result) exit_codes = [0, 1, 2, -9]
elif not is_autorun: @@ -340,6 +349,7 @@
_arguments = '-help' _results = None + _skip_results = {}
class TestScriptSimulate(DefaultSiteTestCase, PwbTestCase, @@ -368,6 +378,7 @@
_arguments = '-simulate' _results = no_args_expected_results + _skip_results = skip_on_results
if __name__ == '__main__': # pragma: no cover
pywikibot-commits@lists.wikimedia.org