mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-02-06 05:57:21 +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:
28
.coveragerc
Normal file
28
.coveragerc
Normal file
@@ -0,0 +1,28 @@
|
||||
[coverage:run]
|
||||
source = yt_dlp, devscripts
|
||||
omit =
|
||||
*/extractor/lazy_extractors.py
|
||||
*/__pycache__/*
|
||||
*/test/*
|
||||
*/yt_dlp/compat/_deprecated.py
|
||||
*/yt_dlp/compat/_legacy.py
|
||||
data_file = .coverage
|
||||
|
||||
[coverage:report]
|
||||
exclude_lines =
|
||||
pragma: no cover
|
||||
def __repr__
|
||||
raise NotImplementedError
|
||||
if __name__ == .__main__.:
|
||||
pass
|
||||
raise ImportError
|
||||
except ImportError:
|
||||
warnings\.warn
|
||||
if TYPE_CHECKING:
|
||||
|
||||
[coverage:html]
|
||||
directory = .coverage-reports/html
|
||||
title = yt-dlp Coverage Report
|
||||
|
||||
[coverage:xml]
|
||||
output = .coverage-reports/coverage.xml
|
||||
Reference in New Issue
Block a user