Allow `test_throws` to take an user-defined exception type
Merge pull request #6727 from kshramt/kshramt/fix_test_throws

Allow `test_throws` to take an user-defined exception type