| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | import argparse | |
| 2 | 2 | import os | |
| 3 | + import shlex | ||
| 3 | 4 | import sys | |
| 4 | 5 | from test.support import os_helper | |
| 5 | 6 | ||
@@ -372,8 +373,11 @@ def _parse_args(args, **kwargs): | |||
| 372 | 373 | parser.error("-s and -f don't go together!") | |
| 373 | 374 | if ns.use_mp is not None and ns.trace: | |
| 374 | 375 | parser.error("-T and -j don't go together!") | |
| 375 | - if ns.python is not None and ns.use_mp is None: | ||
| 376 | - parser.error("-p requires -j!") | ||
| 376 | + if ns.python is not None: | ||
| 377 | + if ns.use_mp is None: | ||
| 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) | ||
| 377 | 381 | if ns.failfast and not (ns.verbose or ns.verbose3): | |
| 378 | 382 | parser.error("-G/--failfast needs either -v or -W") | |
| 379 | 383 | if ns.pgo and (ns.verbose or ns.verbose2 or ns.verbose3): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -306,13 +306,22 @@ def list_cases(self): | |||
| 306 | 306 | printlist(self.skipped, file=sys.stderr) | |
| 307 | 307 | ||
| 308 | 308 | def rerun_failed_tests(self): | |
| 309 | + self.log() | ||
| 310 | + | ||
| 311 | + if self.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 | + | ||
| 309 | 319 | self.ns.verbose = True | |
| 310 | 320 | self.ns.failfast = False | |
| 311 | 321 | self.ns.verbose3 = False | |
| 312 | 322 | ||
| 313 | 323 | self.first_result = self.get_tests_result() | |
| 314 | 324 | ||
| 315 | - self.log() | ||
| 316 | 325 | self.log("Re-running failed tests in verbose mode") | |
| 317 | 326 | rerun_list = list(self.need_rerun) | |
| 318 | 327 | self.need_rerun.clear() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,6 @@ | |||
| 2 | 2 | import json | |
| 3 | 3 | import os | |
| 4 | 4 | import queue | |
| 5 | - import shlex | ||
| 6 | 5 | import signal | |
| 7 | 6 | import subprocess | |
| 8 | 7 | import sys | |
@@ -57,8 +56,7 @@ def run_test_in_subprocess(testname: str, ns: Namespace) -> subprocess.Popen: | |||
| 57 | 56 | worker_args = (ns_dict, testname) | |
| 58 | 57 | worker_args = json.dumps(worker_args) | |
| 59 | 58 | if ns.python is not None: | |
| 60 | - # The "executable" may be two or more parts, e.g. "node python.js" | ||
| 61 | - executable = shlex.split(ns.python) | ||
| 59 | + executable = ns.python | ||
| 62 | 60 | else: | |
| 63 | 61 | executable = [sys.executable] | |
| 64 | 62 | cmd = [*executable, *support.args_from_interpreter_flags(), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments