Skip to content

Commit 012f5b9

Browse files
authored
bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
Rename also run_tests_slave() to run_tests_worker().
1 parent 23e65b2 commit 012f5b9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Lib/test/libregrtest/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _create_parser():
170170
group.add_argument('--wait', action='store_true',
171171
help='wait for user input, e.g., allow a debugger '
172172
'to be attached')
173-
group.add_argument('--slaveargs', metavar='ARGS')
173+
group.add_argument('--worker-args', metavar='ARGS')
174174
group.add_argument('-S', '--start', metavar='START',
175175
help='the name of the test at which to start.' +
176176
more_details)

Lib/test/libregrtest/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,9 @@ def _main(self, tests, kwargs):
542542
print(msg, file=sys.stderr, flush=True)
543543
sys.exit(2)
544544

545-
if self.ns.slaveargs is not None:
546-
from test.libregrtest.runtest_mp import run_tests_slave
547-
run_tests_slave(self.ns.slaveargs)
545+
if self.ns.worker_args is not None:
546+
from test.libregrtest.runtest_mp import run_tests_worker
547+
run_tests_worker(self.ns.worker_args)
548548

549549
if self.ns.wait:
550550
input("Press any key to continue...")

Lib/test/libregrtest/runtest_mp.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424

2525

2626
def run_test_in_subprocess(testname, ns):
27-
"""Run the given test in a subprocess with --slaveargs.
27+
"""Run the given test in a subprocess with --worker-args.
2828
2929
ns is the option Namespace parsed from command-line arguments. regrtest
30-
is invoked in a subprocess with the --slaveargs argument; when the
30+
is invoked in a subprocess with the --worker-args argument; when the
3131
subprocess exits, its return code, stdout and stderr are returned as a
3232
3-tuple.
3333
"""
3434
from subprocess import Popen, PIPE
3535

3636
ns_dict = vars(ns)
37-
slaveargs = (ns_dict, testname)
38-
slaveargs = json.dumps(slaveargs)
37+
worker_args = (ns_dict, testname)
38+
worker_args = json.dumps(worker_args)
3939

4040
cmd = [sys.executable, *support.args_from_interpreter_flags(),
4141
'-u', # Unbuffered stdout and stderr
4242
'-m', 'test.regrtest',
43-
'--slaveargs', slaveargs]
43+
'--worker-args', worker_args]
4444
if ns.pgo:
4545
cmd += ['--pgo']
4646

@@ -58,8 +58,8 @@ def run_test_in_subprocess(testname, ns):
5858
return retcode, stdout, stderr
5959

6060

61-
def run_tests_slave(slaveargs):
62-
ns_dict, testname = json.loads(slaveargs)
61+
def run_tests_worker(worker_args):
62+
ns_dict, testname = json.loads(worker_args)
6363
ns = types.SimpleNamespace(**ns_dict)
6464

6565
setup_tests(ns)

Lib/test/test_regrtest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ def test_wait(self):
6767
ns = libregrtest._parse_args(['--wait'])
6868
self.assertTrue(ns.wait)
6969

70-
def test_slaveargs(self):
71-
ns = libregrtest._parse_args(['--slaveargs', '[[], {}]'])
72-
self.assertEqual(ns.slaveargs, '[[], {}]')
73-
self.checkError(['--slaveargs'], 'expected one argument')
70+
def test_worker_args(self):
71+
ns = libregrtest._parse_args(['--worker-args', '[[], {}]'])
72+
self.assertEqual(ns.worker_args, '[[], {}]')
73+
self.checkError(['--worker-args'], 'expected one argument')
7474

7575
def test_start(self):
7676
for opt in '-S', '--start':

0 commit comments

Comments
 (0)