Add unit tests for functional/platforms/agent_stopper utils (real coverage)#687
Open
wbarnha wants to merge 2 commits into
Open
Add unit tests for functional/platforms/agent_stopper utils (real coverage)#687wbarnha wants to merge 2 commits into
wbarnha wants to merge 2 commits into
Conversation
Convert three coverage gaps into genuine tests instead of leaving them excluded: - utils/functional.py: add a test for translate() (only consecutive_numbers was covered -> 75%); now 100%. Remove its .coveragerc omit. - utils/platforms.py: test max_open_files() across all branches (normal hard limit, RLIM_INFINITY on non-Darwin, RLIM_INFINITY on Darwin via sysctl, and missing 'resource' module); now 100%. Remove its omit. - utils/agent_stopper.py: test that agent_stopper() crashes the app with a RuntimeError; 0% -> 100% (was measured but untested). platforms tests use stacked @patch decorators rather than a parenthesized multi-context 'with' so the file stays valid on Python 3.9.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #687 +/- ##
==========================================
+ Coverage 94.06% 94.14% +0.07%
==========================================
Files 102 104 +2
Lines 11108 11136 +28
Branches 1198 1201 +3
==========================================
+ Hits 10449 10484 +35
+ Misses 558 551 -7
Partials 101 101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Coverage "quick wins" — convert three gaps into genuine tests rather than leaving them excluded from coverage. Each target goes to 100%:
faust/utils/functional.pyconsecutive_numberstested)translate()test (incl. multi-char patterns and empty table) → 100%; remove its.coveragercomitfaust/utils/platforms.pymax_open_files()across all branches — normal hard limit,RLIM_INFINITYon non-Darwin,RLIM_INFINITYon Darwin (viasysctl), and missingresourcemodule → 100%; remove its.coveragercomitfaust/utils/agent_stopper.pyagent_stopper()crashes the app withRuntimeError→ 100%So
functional.pyandplatforms.pycome off the.coveragercomit list — their coverage is now real and enforced going forward, not hidden.Notes
platformstests use stacked@patchdecorators instead of a parenthesized multi-contextwith (...): black (unpinned/26.x, notarget-version) would rewrite the latter to 3.10+ syntax, which would break the Python 3.9 matrix job. The decorator form stays valid on 3.9 and is black-stable.This is the first batch; further un-omissions (e.g.
windows.py,assignor/*, the CLI) are natural follow-ups.Generated by Claude Code