Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ff7b99

Browse files
authored
gh-94052: Don't re-run failed tests with --python option (#94054)
1 parent94eeac0 commit0ff7b99

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

‎Lib/test/libregrtest/cmdline.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
importargparse
22
importos
3+
importshlex
34
importsys
45
fromtest.supportimportos_helper
56

@@ -372,8 +373,11 @@ def _parse_args(args, **kwargs):
372373
parser.error("-s and -f don't go together!")
373374
ifns.use_mpisnotNoneandns.trace:
374375
parser.error("-T and -j don't go together!")
375-
ifns.pythonisnotNoneandns.use_mpisNone:
376-
parser.error("-p requires -j!")
376+
ifns.pythonisnotNone:
377+
ifns.use_mpisNone:
378+
parser.error("-p requires -j!")
379+
# The "executable" may be two or more parts, e.g. "node python.js"
380+
ns.python=shlex.split(ns.python)
377381
ifns.failfastandnot (ns.verboseorns.verbose3):
378382
parser.error("-G/--failfast needs either -v or -W")
379383
ifns.pgoand (ns.verboseorns.verbose2orns.verbose3):

‎Lib/test/libregrtest/main.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,22 @@ def list_cases(self):
306306
printlist(self.skipped,file=sys.stderr)
307307

308308
defrerun_failed_tests(self):
309+
self.log()
310+
311+
ifself.ns.python:
312+
# Temp patch for https://github.com/python/cpython/issues/94052
313+
self.log(
314+
"Re-running failed tests is not supported with --python "
315+
"host runner option."
316+
)
317+
return
318+
309319
self.ns.verbose=True
310320
self.ns.failfast=False
311321
self.ns.verbose3=False
312322

313323
self.first_result=self.get_tests_result()
314324

315-
self.log()
316325
self.log("Re-running failed tests in verbose mode")
317326
rerun_list=list(self.need_rerun)
318327
self.need_rerun.clear()

‎Lib/test/libregrtest/runtest_mp.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
importjson
33
importos.path
44
importqueue
5-
importshlex
65
importsignal
76
importsubprocess
87
importsys
@@ -59,8 +58,7 @@ def run_test_in_subprocess(testname: str, ns: Namespace, tmp_dir: str) -> subpro
5958
worker_args= (ns_dict,testname)
6059
worker_args=json.dumps(worker_args)
6160
ifns.pythonisnotNone:
62-
# The "executable" may be two or more parts, e.g. "node python.js"
63-
executable=shlex.split(ns.python)
61+
executable=ns.python
6462
else:
6563
executable= [sys.executable]
6664
cmd= [*executable,*support.args_from_interpreter_flags(),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp