jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/769407 )
Change subject: [tests] let timeout be set by test class ......................................................................
[tests] let timeout be set by test class
Add _timeout attribute to script_tests test classes to determine whether a timeout should be used. The value must be either a boolean or a list of script names.
Change-Id: I415ce72be4f699236285078b72cd42d874d0d3e3 --- M tests/script_tests.py 1 file changed, 7 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 3747db5..e66c465 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -206,7 +206,11 @@
cmd = global_args + [script_name] + args data_in = script_input.get(script_name) - timeout = 5 if is_autorun else None + if isinstance(self._timeout, bool): + do_timeout = self._timeout + else: + do_timeout = script_name in self._timeout + timeout = 5 if do_timeout else None
stdout, error = None, None if self._results and script_name in self._results: @@ -349,6 +353,7 @@ _arguments = '-help' _results = None _skip_results = {} + _timeout = False
class TestScriptSimulate(DefaultSiteTestCase, PwbTestCase, @@ -378,6 +383,7 @@ _arguments = '-simulate' _results = no_args_expected_results _skip_results = skip_on_results + _timeout = auto_run_script_list
if __name__ == '__main__': # pragma: no cover
pywikibot-commits@lists.wikimedia.org