Avoid bare pytest.raises in dtypes/test_dtypes.py
* [x]  ref #30999
 
* [x]  tests added / passed
 
* [x]  passes `black pandas`

* [x]  passes `git diff origin/master -u -- "*.py" | flake8 --diff`

Please be aware that I changed dtypes.py as there was a typo in the exception message.