Fix test comparison ops check for scalar overflow (#48597)
Summary:
Test should verify, that all listed conditions throw, not just the first one
Refactor duplicated constants
Use `self.assertTrue()` instead of suppressing flake8 `B015: Pointless Comparison` warning
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48597
Reviewed By: mruberry
Differential Revision: D25222734
Pulled By: malfet
fbshipit-source-id: 7854f755a84f23a1a52dc74402582e34d69ff984