jenkins-bot submitted this change.
[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(-)
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
To view, visit change 761936. To unsubscribe, or for help writing mail filters, visit settings.