-
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.commands.upload (take 2) #627
Conversation
Hi @bhrutledge Thank you for creating this PR to better apply the suggestions you provided me in the last PR. Having said that, I had a few questions. I thought that it was almost at the finish line, and the back-and-forth there is part of a standard in the PR review process. I understand that there was some struggle from my end to clearly put across and understand what was needed in this PR, but I thought that is part of the learning process of being a contributor. It would be helpful to know how can I avoid such a situation in my future contributions to twine, and make the experience enjoyable for all of us, where the communication parameters/frequency are moderated such that this doesn't happen in future, and my PRs can see the finish line. |
tests/test_upload.py
Outdated
stub_response = pretend.stub( | ||
is_redirect=False, status_code=201, raise_for_status=lambda: None | ||
) | ||
|
||
stub_repository = pretend.stub( | ||
upload=pretend.call_recorder(lambda package: stub_response), | ||
close=lambda: None, | ||
release_urls=lambda _: None, | ||
) | ||
|
||
upload_settings = make_settings() | ||
upload_settings.create_repository = lambda: stub_repository |
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.
So we are going to extract this part into a fixture which will live within test_upload
and will make this more readable, or is this something which can be moved to conftest.py
is this pattern is repeated in other tests as well?
@deveshks Thanks for your thoughts, and for your contributions. I mean no offense. I'm also learning to be a maintainer, and trying to find the right balance between time spent nurturing contributions vs. time spent on improving twine. So, this second PR was a bit of an experiment, which I thought would still highlight your contribution via the commit author, without force-pushing to your branch. That said, if I were in your shoes, I'd rather have my original PR merged. That said, if you restore your deleted branch (which I think the GitHub UI enables), and don't mind me force-pushing to it, I can reopen #622, and close this. |
Thanks for your response, and I apologise if my response on this and the other PR offended you in any way as well.
I really appreciate your thoughtfulness for allowing me to reopen the old PR. I have gone ahead and restored the branch in #622 , you can force-push to it. |
Please do also let me know if you face difficulties force-pushing to the branch. I remember checking the Edit: If you don't mine opening the PR, I can also pull the commits here and force-push them there. I tried checking the checkbox again, but there seems to be a UI bug where if I refresh the page, it goes away. I even tried it via https://developer.github.com/v3/pulls/#update-a-pull-request , but that seems to not work as well. |
2530852
to
3e272f4
Compare
3e272f4
to
167a3c7
Compare
Closing in favor of #622. |
Building on #622 from @deveshks. Happy to receive feedback and answer questions.
Changes:
Rebased on
master
5e33607: Add more information to comments and make
test_successful_upload_sign_package
follow the same pattern astest_successful_upload_add_gpg_signature
2530852: Reduce patching complexity by making assertions on the package passed to
repository.upload()
TODO:
stub_repository
to maketest_successful_upload*
easier to read