Make GammapyDeprecationWarnings and AstropyDepecrationWarning errors in tests
@@ -27,3 +27,9 @@ exclude = '''
| gammapy/extern
)/
'''
+
+[tool.pytest.ini_options]
+filterwarnings = [
+ "error::astropy.utils.exceptions.AstropyDeprecationWarning",
+ "error::gammapy.utils.deprecation.GammapyDeprecationWarning",
+]
