facebookresearch / Pearl

A Production-ready Reinforcement Learning AI Agent Library brought by the Applied Reinforcement Learning team at Meta.
MIT License
2.6k stars 157 forks source link

Use torch.testing in unit tests #86

Closed alexnikulkov closed 5 months ago

alexnikulkov commented 5 months ago

Summary: Regular asserts like self.assertTrue(torch.equal(actions[i], action)) don't print an informative message when they fail. Replacing with torch.testing asserts, which print out useful information for debugging

Differential Revision: D56644803

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.91%. Comparing base (3200afa) to head (1100da0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #86 +/- ## ========================================== + Coverage 79.87% 79.91% +0.04% ========================================== Files 172 172 Lines 6593 6602 +9 ========================================== + Hits 5266 5276 +10 + Misses 1327 1326 -1 ``` | [Flag](https://app.codecov.io/gh/facebookresearch/Pearl/pull/86/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebookresearch) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/facebookresearch/Pearl/pull/86/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebookresearch) | `79.91% <100.00%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebookresearch#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.