Skip to content

Commit

Permalink
Remove deprecation warning for astropy resolve_name under astropy 7.0.0
Browse files Browse the repository at this point in the history
by switching to importlib.import_module()
  • Loading branch information
stscirij committed Dec 3, 2024
1 parent c512a57 commit d63b7c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def pytest_report_header(config):
import sys
import warnings
from astropy.utils.introspection import resolve_name
import importlib

s = "\nFull Python Version: \n{0}\n\n".format(sys.version)

Expand All @@ -24,7 +24,7 @@ def pytest_report_header(config):
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
module = resolve_name(module_name)
module = importlib.import_module(module_name)
except ImportError:
s += "{0}: not available\n".format(module_name)
else:
Expand Down

0 comments on commit d63b7c9

Please sign in to comment.