Use assertRaisesRegexWithHighlight test_class_type.py (#55510)
Summary:
Step to resolving https://github.com/pytorch/pytorch/issues/55072
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55510
Reviewed By: gmagogsfm
Differential Revision: D27627208
Pulled By: janeyx99
fbshipit-source-id: 6cfbd4523ebd9803496fbdc5128b91110e87e07a