test: document empty input behavior in get_value_vars_from_user_vars#8031
test: document empty input behavior in get_value_vars_from_user_vars#8031ricardoV94 merged 3 commits intopymc-devs:mainfrom
Conversation
|
Why do you feel this is needed? |
tests/test_util.py
Outdated
There was a problem hiding this comment.
You can add it in the first block of checks from the first model. It doesn't need to be tested with an empty model?
There was a problem hiding this comment.
The reason for adding this check is to explicitly document the current contract that empty input is a valid case and returns an empty list, rather than failing implicitly or raising an error. Without an explicit test, this behavior could
easily change unintentionally during refactors without being caught.
I agree that the behavior itself does not depend on model contents, and placing the assertion alongside the existing model1 checks makes the intent clearer. I’ve moved it there.
I’m still getting familiar with the PyMC codebase, if there are particular parts you’d recommend focusing on early when exploring the codebase, I’d appreciate any pointers.
Thanks for the review.
|
I'm approving this one @jyotihotwani25 , but I feel it's a code-change looking for a reason rather than the other way around. Python is loosely typed and any function that accepts/returns containers will have empty edge case. I don't believe we should test it all just "because". I suggest looking for code changes that are meaningful to the users for your next steps (if you so wish to proceed), or actual bug-fixes. Rule-of-thumb: if there's no issue open for it, it's probably not a good first issue |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8031 +/- ##
=======================================
Coverage 91.44% 91.45%
=======================================
Files 116 116
Lines 18971 19025 +54
=======================================
+ Hits 17348 17399 +51
- Misses 1623 1626 +3 🚀 New features to boost your workflow:
|
|
Thanks for the approval and the feedback. I’ll focus future contributions on more clearly user-facing and impactful changes. |
Description
This PR adds a test documenting that
get_value_vars_from_user_vars([], model)returns an empty list when given empty input.The test reflects the current behavior and improves coverage for an edge case without changing any functionality.
Related Issue
Checklist
Type of change