-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Refactor test_transforms.py into classes #4030
Refactor test_transforms.py into classes #4030
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.
Also just to make sure the tests themselves remain unchanged.
For test_transforms.py,
Before this PR : 886 tests passed 5 skipped.
After this PR : (EDIT) 886 tests passed 5 skipped.
@NicolasHug Please take a look whenever you have some time. Thanks :)) |
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 the PR @AnirudhDagar
I see the value in grouping the "to tensor" and the "to pil" tests into their respective classes.
For other cases though it's not as obvious. For example, it's not obvious whether test_randomresized_params
should be in TestResize
or in TestRandomX
.
Since moving tests around does come with the cost of adding an extra step in the git blame (which isn't negligible when it comes to maintenance), I'd suggest to only keep the TestToTensor
and TestToPil
classes for now.
Hopefully this will also reduce the size of the PR, making it easier to review. I'm happy to consider further changes in the future (I can't promise they'll be merged though), but I'd suggest to leave that for other PRs.
Thanks for the feedback @NicolasHug! I had a similar doubt as well while grouping a few tests. I also understand your very valid point on git blame and maintenance. As suggested, I'll update the PR to include |
@NicolasHug I've made the changes, hopefully now the PR should be manageable for a review. Tests are all green as well! :) |
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 @AnirudhDagar
For the rest I think the only really obvious ones would be to group the Thanks a ton for your work @AnirudhDagar ! |
Thanks for your valuable feedback and detailed reviews @NicolasHug ! Let me know if there are any other issues where I can help. Ps. I'll try to work on re-enabling the broken cpp tests ( |
If you're interested, #4063 is not taken yet ;) |
Reviewed By: fmassa Differential Revision: D29264315 fbshipit-source-id: 299ef84e1f91049af3e05be185a5578e6327f410
This is a follow-up PR as discussed here (#3982 comment) after porting of unittest to pytest. See #3945
@NicolasHug I apologize for the unusually large diff in this single PR, but there is no logical change other than a few that I'll explicitly mark. Please let me know if I can help in getting this reviewed in any possible way.