MCPcopy
hub / github.com/ModelEngine-Group/nexent / _combine_coverage

Function _combine_coverage

test/run_all_test.py:272–290  ·  view source on GitHub ↗
(current_dir: Path, project_root: Path)

Source from the content-addressed store, hash-verified

270
271
272def _combine_coverage(current_dir: Path, project_root: Path) -> bool:
273 coverage_data_file = current_dir / ".coverage"
274 for path in (coverage_data_file,):
275 if path.exists():
276 path.unlink()
277
278 combine_cmd = _coverage_command(
279 "combine",
280 "--data-file",
281 str(coverage_data_file),
282 str(current_dir),
283 )
284 coverage_env = _coverage_env(project_root)
285 combine = subprocess.run(combine_cmd, cwd=project_root, env=coverage_env, text=True, capture_output=True)
286 if combine.returncode != 0:
287 logger.error("Coverage combine failed:\n%s\n%s", combine.stdout, combine.stderr)
288 return False
289 logger.info("Coverage data combined: %s", coverage_data_file)
290 return True
291
292
293def _report_coverage(current_dir: Path) -> bool:

Callers 1

run_testsFunction · 0.85

Calls 5

_coverage_commandFunction · 0.85
_coverage_envFunction · 0.85
errorMethod · 0.80
existsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected