-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Codemod Unittest assertions to bare asserts #1301
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Hi @akx
Thanks for your contribution !
few tests are failing with:
FAILED tests/test_core.py::CoreTester::test_masked_whiten - TypeError: type Tensor doesn't define __round__ method
I think adding .item()
on those would fix the tests - could you please have a look? 🙏
@younesbelkada Sure thing. Pushed a commit that hand-rewrites the |
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.
Sorry for the additional iteration @akx ! Could you also fix
FAILED tests/test_reward_trainer.py::RewardTrainerTester::test_reward_trainer_margin
? 🙏 Thanks !
2c1d460
to
4021cc9
Compare
Should be good to go again, I gave the failing test a spin locally (which took some editing because the tests don't run OOTB on |
Thanks very much @akx - just re-ran the CI |
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.
Huge work ! Thanks !
* Remove stray commas from test data * Codemod Unittest assertions to bare asserts * Make `assertAlmostEqual` tests more idiomatic * DRY some test strings
This PR runs https://github.com/akx/codemod-unittest-to-pytest-asserts to rewrite Unittest
self.assert...
assertions as plain assertions that can be introspected by Pytest's assert rewriting.