Page MenuHomePhabricator

Enable global args with pwb.py script for tests
Closed, ResolvedPublic

Description

pwb.py is a wrapper script to use pywikibot if the framework isn't installed as a side package. All given argumets are passed to the called script and the usage is

pwb.py <name_of_script> <options>

Tests can also be started with the pwb wrapper and the usage is

pwb.py <name_of_test_script> <test options>

where <name_of_test_script> is a script path for tests inside test path or the script name if 'tests' is included to the user_script_paths in user-config.py. <test options> are further unittests options. A sample can demonstrate it:

pwb.py pwb_tests -v TestPwb.test_env

tests test_env method of TestPwb TestCase class with verbose option

Now there are a lot of tests using a default site from user-config.py. To change this default site you have to change it in that config file and run test after that. I propose to have the global options -lang and -family working with pwb for tests like

pwb.py <site option> <name_of_test_script> <test options>

like

pwb.py -lang:cs site_tests -v TestSiteObject.test_repr

Event Timeline

Xqt renamed this task from Enable global args with pw.py script for tests to Enable global args with pwb.py script for tests.Feb 22 2019, 2:24 PM
Xqt triaged this task as Low priority.

Change 495479 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Enable global args with pwb.py script

https://gerrit.wikimedia.org/r/495479

Change 495479 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Enable global args with pwb.py script

https://gerrit.wikimedia.org/r/495479

Change 495479 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Enable global args with pwb.py script

https://gerrit.wikimedia.org/r/495479