mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
gh-109162: libregrtest: add worker.py (#109229)
Add new worker.py file: * Move create_worker_process() and worker_process() to this file. * Add main() function to worker.py. create_worker_process() now runs the command: "python -m test.libregrtest.worker JSON". * create_worker_process() now starts the worker process in the current working directory. Regrtest now gets the absolute path of the reflog.txt filename: -R command line option filename. * Remove --worker-json command line option. Remove test_regrtest.test_worker_json(). Related changes: * Add write_json() and from_json() methods to TestResult. * Rename select_temp_dir() to get_temp_dir() and move it to utils. * Rename make_temp_dir() to get_work_dir() and move it to utils. It no longer calls os.makedirs(): Regrtest.main() now calls it. * Move fix_umask() to utils. The function is now called by setup_tests(). * Move StrPath to utils. * Add exit_timeout() context manager to utils. * RunTests: Replace junit_filename (StrPath) with use_junit (bool).
This commit is contained in:
parent
e55aab9578
commit
a939b65aa6
10 changed files with 238 additions and 213 deletions
|
@ -75,11 +75,6 @@ class ParseArgsTestCase(unittest.TestCase):
|
|||
ns = libregrtest._parse_args(['--wait'])
|
||||
self.assertTrue(ns.wait)
|
||||
|
||||
def test_worker_json(self):
|
||||
ns = libregrtest._parse_args(['--worker-json', '[[], {}]'])
|
||||
self.assertEqual(ns.worker_json, '[[], {}]')
|
||||
self.checkError(['--worker-json'], 'expected one argument')
|
||||
|
||||
def test_start(self):
|
||||
for opt in '-S', '--start':
|
||||
with self.subTest(opt=opt):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue