Fix ``treat_deprecations_as_exceptions`` to recognize Astropy deprecation warnings.
Allow opt-out of treating astropy deprecation warnings as exceptions
Merge pull request #3015 from astrofrog/fix-treat-deprecations-as-exceptions

Fix ``treat_deprecations_as_exceptions`` to recognize Astropy deprecation warnings