1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-31 12:01:36 +00:00

[test] Add code coverage framework

Implement a comprehensive test coverage framework that integrates with pytest-cov
to generate code coverage reports for the yt-dlp codebase. Key components:

- Configuration file (.coveragerc) with appropriate include/exclude patterns
- Helper script (run_coverage.py) with parallel report generation
- GitHub Actions workflow for automatic coverage reporting on PRs and pushes
- Support for Hatch testing environment and CLI integration
- Testing documentation for running coverage reports
- Sample test for demonstrating coverage reporting
This commit is contained in:
Wilson Bilkovich
2025-03-09 01:45:57 -05:00
parent 05c8023a27
commit 1e7c02ca48
9 changed files with 311 additions and 1 deletions

View File

@@ -81,6 +81,7 @@ static-analysis = [
test = [
"pytest~=8.1",
"pytest-rerunfailures~=14.0",
"pytest-cov~=6.0",
]
pyinstaller = [
"pyinstaller>=6.11.1", # Windows temp cleanup fixed in 6.11.1
@@ -161,11 +162,12 @@ features = ["test"]
dependencies = [
"pytest-randomly~=3.15",
"pytest-xdist[psutil]~=3.5",
"pytest-cov~=6.0",
]
[tool.hatch.envs.hatch-test.scripts]
run = "python -m devscripts.run_tests {args}"
run-cov = "echo Code coverage not implemented && exit 1"
run-cov = "python -m devscripts.run_coverage {args}"
[[tool.hatch.envs.hatch-test.matrix]]
python = [