feat: pytest-cov configuration and test audit cleanup

Add full pytest-cov configuration with fail_under=60% threshold,
HTML/XML report targets, and proper exclude_lines. Fix websocket
history test to use public broadcast() API instead of manually
manipulating internals. Audit confirmed 491 tests at 71.2% coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexander Payne
2026-02-22 20:42:58 -05:00
parent 14072f9bb5
commit ca60483268
4 changed files with 41 additions and 11 deletions

View File

@@ -83,4 +83,27 @@ addopts = "-v --tb=short"
[tool.coverage.run]
source = ["src"]
omit = ["*/tests/*"]
omit = [
"*/tests/*",
"src/dashboard/routes/mobile_test.py",
]
[tool.coverage.report]
show_missing = true
skip_empty = true
precision = 1
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@abstractmethod",
]
# Fail CI if coverage drops below this threshold
fail_under = 60
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"