From c5b48d7a8b5c896055c7a36959a141d52b4c53f8 Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Thu, 1 Jun 2023 13:44:41 -1000 Subject: [PATCH 1/2] Remove deprecated call to astropy helpers. Closes #553 --- astroplan/conftest.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/astroplan/conftest.py b/astroplan/conftest.py index 6c40ad56..aef191d6 100644 --- a/astroplan/conftest.py +++ b/astroplan/conftest.py @@ -15,8 +15,6 @@ PYTEST_HEADER_MODULES = {} TESTED_VERSIONS = {} -from astropy.tests.helper import enable_deprecations_as_exceptions - # We do this to pick up the test header report even when using LTS astropy try: from astropy.tests.pytest_plugins import pytest_report_header # noqa @@ -35,11 +33,6 @@ packagename = os.path.basename(os.path.dirname(__file__)) TESTED_VERSIONS[packagename] = version - -# Comment out this line to avoid deprecation warnings being raised as -# exceptions -enable_deprecations_as_exceptions() - # Define list of packages for which to display version numbers in the test log try: PYTEST_HEADER_MODULES['Astropy'] = 'astropy' From 9cc6f89d54c79476135959fffd96933bde060cea Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Thu, 1 Jun 2023 13:55:34 -1000 Subject: [PATCH 2/2] Add the warnings-as-errors functionality via pytest options. --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3c71eec7..be322bac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,6 +48,8 @@ doctest_plus = enabled text_file_format = rst addopts = --doctest-rst --doctest-ignore-import-errors norecursedirs = build docs/_build +filterwarnings = + error::DeprecationWarning [coverage:run] omit = @@ -89,4 +91,3 @@ max-line-length = 100 [pycodestyle] exclude = _astropy_init.py,extern,__init__.py max-line-length = 100 -