run_coverage.py 464 B

12345678910111213141516171819202122
  1. import pytest
  2. from pathlib import Path
  3. # Small helper script to run the coverage of main code & all plugins
  4. path = Path("plugins")
  5. args = ["--cov" ,"cura" , "--cov-report", "html"]
  6. all_paths = []
  7. for p in path.glob('**/*'):
  8. if p.is_dir():
  9. if p.name in ["__pycache__", "tests"]:
  10. continue
  11. args.append("--cov")
  12. args.append(str(p))
  13. all_paths.append(str(p))
  14. for path in all_paths:
  15. args.append(path)
  16. args.append(".")
  17. args.append("-x")
  18. pytest.main(args)