MCPcopy Index your code
hub / github.com/python/cpython / _run_bisect

Method _run_bisect

Lib/test/libregrtest/main.py:321–353  ·  view source on GitHub ↗
(self, runtests: RunTests, test: str, progress: str)

Source from the content-addressed store, hash-verified

319 self.display_result(rerun_runtests)
320
321 def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool:
322 print()
323 title = f"Bisect {test}"
324 if progress:
325 title = f"{title} ({progress})"
326 display_title(title)
327
328 cmd = runtests.create_python_cmd()
329 cmd.extend([
330 "-u", "-m", "test.bisect_cmd",
331 # Limit to 25 iterations (instead of 100) to not abuse CI resources
332 "--max-iter", "25",
333 "-v",
334 # runtests.match_tests is not used (yet) for bisect_cmd -i arg
335 ])
336 cmd.extend(runtests.bisect_cmd_args())
337 cmd.append(test)
338 print("+", shlex.join(cmd), flush=True)
339
340 flush_std_streams()
341
342 import subprocess
343 proc = subprocess.run(cmd, timeout=runtests.timeout)
344 exitcode = proc.returncode
345
346 title = f"{title}: exit code {exitcode}"
347 display_title(title)
348
349 if exitcode:
350 print(f"Bisect failed with exit code {exitcode}")
351 return False
352
353 return True
354
355 def run_bisect(self, runtests: RunTests) -> None:
356 tests, _ = self.results.prepare_rerun(clear=False)

Callers 1

run_bisectMethod · 0.95

Calls 8

flush_std_streamsFunction · 0.90
display_titleFunction · 0.85
create_python_cmdMethod · 0.80
extendMethod · 0.45
bisect_cmd_argsMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected