MCPcopy Index your code
hub / github.com/RustPython/RustPython / _run_bisect

Method _run_bisect

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

Source from the content-addressed store, hash-verified

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

Callers 1

run_bisectMethod · 0.95

Calls 9

flush_std_streamsFunction · 0.90
lenFunction · 0.85
create_python_cmdMethod · 0.80
printFunction · 0.50
extendMethod · 0.45
bisect_cmd_argsMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected