-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests to twine.repository #604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the coverage! As a bit of hopefully constructive feedback, I probably would have started with a PR that only added coverage, and asked questions in the PR description about the refactoring and docstrings, before making those changes. That would have made the additions easier for the maintainers to review and merge, and possibly saved you time spent on making changes, and all of us time spent on comment threads.
I think what you mean is that first start with adding code for coverage, and then ask if the already added code can be refactored in terms of changing the logic, or adding docstring which will cause existing code to be changed, and make the changes only if the permission is granted. Also in terms of refactoring, can I go ahead and add commits which explicitly states the changes made, but maybe for others, ask questions about the possible approach on how to refactor the code and then do it? |
I have gone ahead and made the suggested changes. I will start with only making incremental additions in newer PRs, and any potential refactoring of existing code on a case-to-case basis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sticking with this, @deveshks. You seem to have a good understanding of what to test and how to test it, and that's appreciated. My comments are intended to build on that, add a bit more polish to your work, and hopefully streamline future contributions.
Re: my earlier comments on refactoring, I think you understood what I was getting at. In general, and within reason, I think it's wise to keep the scope of PR narrow, e.g. keeping refactoring distinct from adding/changing behavior. Of course, I ignored my own advice as recently as this morning: #608 (review).
Finally, my thinking on testing has evolved a lot over the last few years, most recently via Why Good Developers Write Bad Tests at PyGotham 2019.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! I'm going to hold on merging this until after #608, because that's got a spurious coverage failure, and this should give master
a clean result.
Towards #7
Add more unit tests to
twine.repository
to bring the coverage up to 99%