Achieve 100% test coverage and hide fully covered files from reports#356
Achieve 100% test coverage and hide fully covered files from reports#356Kludex merged 3 commits intosupport-python-314from
Conversation
- Added tests for CustomHandler.infer() and __call__() methods - Fixed test_lifespan_failure to use elif and pragma: no cover for unreachable code - Removed unused mock_lambda_at_edge_event fixture from conftest.py - Added skip_covered = true to coverage report configuration Co-authored-by: Kludex <7353520+Kludex@users.noreply.github.com>
Co-authored-by: Kludex <7353520+Kludex@users.noreply.github.com>
|
@copilot why do we need to remove that fixture? Where it was used? |
The fixture in The fixture version (in conftest.py) expected 4 parameters via The fixture was causing the conftest.py file to show as only 75% covered since its 66 lines were never executed. Removing it improved coverage without affecting any tests. |
Test coverage was at 99% with several untested code paths. Coverage reports showed all files including those with 100% coverage, making it harder to identify gaps.
Changes
Added missing test coverage
test_custom_handler_infer()- TestsCustomHandler.infer()with positive/negative event matchingtest_custom_handler_call()- Verifies response formatting inCustomHandler.__call__()Removed dead code
mock_lambda_at_edge_eventfixture fromconftest.py(shadowed by local function intest_lambda_at_edge.py)Fixed test logic in
test_lifespan_failureiftoeliffor proper message type handling# pragma: no cover(covered bytest_lifespan_state)Configured coverage report filtering
skip_covered = trueto[tool.coverage.report]inpyproject.tomlResult
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.sh/usr/bin/curl curl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.