diff --git a/astroquery/conftest.py b/astroquery/conftest.py index 065ba0069e..9bca6d3f69 100644 --- a/astroquery/conftest.py +++ b/astroquery/conftest.py @@ -26,3 +26,15 @@ def pytest_configure(config): except ImportError: # assume astropy v<0.3 pass + + +# Add astropy to test header information and remove unused packages. +# Pytest header customisation was introduced in astropy 1.0. + +try: + PYTEST_HEADER_MODULES['astropy'] = 'astropy' + del PYTEST_HEADER_MODULES['h5py'] + del PYTEST_HEADER_MODULES['Scipy'] + del PYTEST_HEADER_MODULES['Matplotlib'] +except NameError: + pass