fix: pluralize function signature and test update#10450
fix: pluralize function signature and test update#10450eslteacher902010 wants to merge 3 commits into
Conversation
Reviewer's GuideRefactors the pluralize helper to use a clear (count, singular) signature with logic to append “s” for non-unit counts and updates tests accordingly to resolve existing failures. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @eslteacher902010 - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
I did not even know that such a function exists. 😅
Can you please use pytest.mark.parametrize instead of calling the function multiple times in the test.
And please take a look at the failing pre-commit.ci. See also https://python-poetry.org/docs/contributing/#local-development
Thanks for the feedback! I removed the obsolete test_shell.py (now that I understand the shell logic lives in a plugin) and added a test file for the helper functions (pluralize, is_dir_writable, and parse_requires). I also updated the tests to use pytest.mark.parametrize where appropriate. Let me know if there’s anything else I should tweak! |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
This PR improves test coverage and clarity for three utility functions:
pluralize: Updated signature to take both a count and singular word, defaulting to appending "s" when appropriate.
parse_requires: Added tests to validate parsing of multiline requirement strings.
is_dir_writable: Added cross-platform tests for directory writability, including permission errors and missing directories.
These changes fix test mismatches, improve clarity, and increase overall reliability of Poetry’s helper functions.