test: add coverage for config_manager and env_checker#390
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #390 +/- ##
==========================================
+ Coverage 70.98% 72.59% +1.60%
==========================================
Files 33 33
Lines 3915 3915
==========================================
+ Hits 2779 2842 +63
+ Misses 1136 1073 -63 see 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
10ad2fc to
0219eff
Compare
0219eff to
5212da6
Compare
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.
Both config_manager.py and env_checker.py had zero unit test coverage. This adds 58 tests across two new files covering all public methods.
test_config_manager.py (36 tests) covers
load()with background parsing and stale PID cleanup,write_config()directory creation,set()/get()round-trips,get_bool()with all accepted formats,get_or_override()priority (CLI > env > config),get_env_data()output for all config combinations, andremove_background().test_env_checker.py (22 tests) covers
format_python_version()old/modern boundary,check_comfy_server_running()with mocked requests, andEnvCheckermethods includingcheck()with virtualenv/conda detection,is_isolated_env(),get_isolated_env(), andfill_print_table().Both modules use the
@singletondecorator, so tests extract the original class from the wrapper closure to construct isolated instances backed bytmp_path.