From 2ee5c1a9234341b2438788199a1f5ec58501f29b Mon Sep 17 00:00:00 2001 From: Stephen Bailey Date: Wed, 14 Aug 2024 14:22:25 -0700 Subject: [PATCH] support github tests without DESI_SPECTRO_CALIB set --- py/desispec/test/test_calibfinder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 """