desihub / specsim

Quick simulations of spectrograph response
2 stars 9 forks source link

Fix unittest errors on astropy >= 5.1 #124

Closed dylanagreen closed 1 year ago

dylanagreen commented 1 year ago

This short PR performs four small tasks that allow specsim's unit tests to run on astropy versions >= 5.1, fixing #123:

  1. Comments out (but does not remove) the unused and currently deprecated and marked for future removal from astropy.tests.helper import enable_deprecations_as_exceptions from conftest.py
  2. Removes from astropy.tests.plugins.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS and associated commented out code from conftest.py
  3. Removes from astropy.tests.helper import remote_data from test_observations.py (where it was unused) and test_transform.py
  4. Replaces @remote_data with the recommended replacement @pytest.mark.remote_data in test_transform.py

These changes were necessitated from the changelog for astropy v5.1

There are no functional changes to the main body code of specsim, and the changes are confirmed backwards compatible with astropy 5.0.1.

marcelo-alvarez commented 1 year ago

Thanks @dylanagreen. I verified that this fixes #123 on a fresh desiconda installation including astropy/5.2:

% source /global/common/software/desi/users/malvarez/desi_environment.sh local 2.0.1
% git clone --single-branch --fix-123 https://github.com/desihub/specsim
% cd specsim
% python setup.py test
...
============================================ 67 passed, 9 skipped, 15 warnings in 32.15s =============================================

Will merge now.