jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/483721 )
Change subject: [tests] Allow multiple options for script_tests.py
......................................................................
[tests] Allow multiple options for script_tests.py
Currently we only use "-help" and "-simulate" options for script tests.
But we also could do more tests e.g. with generators like
"-simulate -page:Main Page" in future. Therefore the TestScriptMeta
must accept an option string with more than one option.
Change-Id: I717118a0b55b813b4ac2574af72ceb177241ecc1
---
M tests/script_tests.py
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Dvorapa: Looks good to me, but someone else must approve
D3r1ck01: Looks good to me, but someone else must approve
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index edf66b4..354e531 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test that each script can be compiled and executed."""
#
-# (C) Pywikibot team, 2014-2018
+# (C) Pywikibot team, 2014-2019
#
# Distributed under the terms of the MIT license.
#
@@ -330,7 +330,7 @@
return test_skip_script
return testScript
- argument = '-' + dct['_argument']
+ arguments = dct['_arguments']
for script_name in script_list:
# force login to be the first, alphabetically, so the login
@@ -344,9 +344,9 @@
test_name = 'test_' + script_name
cls.add_method(dct, test_name,
- test_execution(script_name, [argument]),
+ test_execution(script_name, arguments.split()),
'Test running {} {}.'
- .format(script_name, argument))
+ .format(script_name, arguments))
if script_name in dct['_expected_failures']:
dct[test_name] = unittest.expectedFailure(dct[test_name])
@@ -385,7 +385,7 @@
_expected_failures.discard('weblinkchecker')
_allowed_failures = []
- _argument = 'help'
+ _arguments = '-help'
_results = None
@@ -417,7 +417,7 @@
'lonelypages', # T94680: uses exit code 1
]
- _argument = 'simulate'
+ _arguments = '-simulate'
_results = no_args_expected_results
--
To view, visit https://gerrit.wikimedia.org/r/483721
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I717118a0b55b813b4ac2574af72ceb177241ecc1
Gerrit-Change-Number: 483721
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits