diff --git a/py/desispec/test/test_calibfinder.py b/py/desispec/test/test_calibfinder.py index 5defcc116..334df3710 100644 --- a/py/desispec/test/test_calibfinder.py +++ b/py/desispec/test/test_calibfinder.py @@ -9,9 +9,10 @@ from importlib import resources import tempfile - from desispec.calibfinder import CalibFinder +_standard_calib_dirs = ('DESI_SPECTRO_CALIB' in os.environ) and ('DESI_SPECTRO_DARK' in os.environ) + class TestCalibFinder(unittest.TestCase): """Test desispec.calibfinder """ @@ -57,6 +58,7 @@ def test_init(self): if cfinder.haskey("BIAS") : print(cfinder.findfile("BIAS")) + @unittest.skipIf(not _standard_calib_dirs, "$DESI_SPECTRO_CALIB or $DESI_SPECTRO_DARK not set") def test_missing_darks(self): """Missing dark files is only fatal if darks are requested """