diff --git a/src/micado/test/functional/dark_test.py b/src/micado/test/functional/dark_test.py index 18bdccb06e470b8bc98de6f57ff90c3272cbfbc8..e965189276bf1a03f67e1da5f2f4c2baf30a3f79 100644 --- a/src/micado/test/functional/dark_test.py +++ b/src/micado/test/functional/dark_test.py @@ -107,7 +107,6 @@ def compare_raws(raw1: Raw, raw2: Raw): def test_dark(): """Test creation of a Dark.""" - Env["use_python_logging"] = True # Set the real dark current and create a DetectorArray. dark_real = 10000.0 @@ -144,7 +143,6 @@ def test_dark(): def test_dark_multi(): """Test creation of a Dark.""" - Env["use_python_logging"] = True # Set the real dark current and create a DetectorArray. dark_real = 10000.0 mydetectorarray = generate_detectorarray(dark=dark_real, size=32, n_det=2) @@ -197,56 +195,9 @@ def test_dark_multi(): remove_file_and_links(dark1.filename) -@pytest.mark.xfail( - reason="TPL CLS is not supported anymore and should be replaced by DPR.* keyword logic." -) -@pytest.mark.skipif(sys.platform.startswith("win"), reason="Test will fail on Windows") -def test_unknown_template(): - """Test an unknown template. - - This should just be ignored with a warning. - """ - # TODO: Fix this test on Windows. - Env["use_python_logging"] = True - - # Generate an image with only 32 by 32 pixels. - dark1 = generate_dark(size=32) - dark1.save_fits() - - # Update the header to refer to a non-existing template. - hdus = fits.open(os.path.realpath(dark1.filename), mode="update") - assert hdus[0].header["WISE TPL CLS"] == MicadoImgCalDark.name_eso() - hdus[0].header["WISE TPL CLS"] = "MCD_does_not_exist" - hdus.close() - - # And try to reopen the file, should print - # Warning: cannot find class MCD_does_not_exist - dark2 = Dark(filename=dark1.filename) - assert dark1 == dark2 - - # Create a Dark without an extension. This is the ESO standard for files - # with only one layer. - hdus = fits.open(os.path.realpath(dark1.filename), mode="update") - hdus[0].header.update(hdus[1].header) - hdus[0].data = hdus[1].data - # Need to fix the output because the header order is wrong. - hdus.close(output_verify="fix") - - # Try to read it. - dark3 = Dark(filename=dark1.filename) - # TODO: Ensure dark1 and dark3 are the same. - # Not an pytest.xfail because the cleanup is not in a fixture yet. - with pytest.raises(AssertionError): - assert dark1 == dark3 - - # Cleanup. - remove_file_and_links(dark1.filename) - - @pytest.mark.skipif(sys.platform.startswith("win"), reason="Test will fail on Windows") def test_template(): """Test reading a template from FITS.""" - Env["use_python_logging"] = True dark_template = MicadoImgCalDark(det__dit=1) diff --git a/src/micado/test/functional/detector_test.py b/src/micado/test/functional/detector_test.py index 89baf6c8f270c3c89a73304edda2bceaeec0fde4..09b9d80b215fa624ad86dc25e082ac39c064bcf9 100644 --- a/src/micado/test/functional/detector_test.py +++ b/src/micado/test/functional/detector_test.py @@ -45,7 +45,6 @@ def generate_detectorarray(dark: float = 2.0, size: int = 32, n_det=1) -> Detect def test_extra_parameters(): """Test whether there is an error when extra parameters are specified.""" - Env["use_python_logging"] = True with pytest.raises(AttributeError): _ = Detector( diff --git a/src/micado/test/functional/detrend_test.py b/src/micado/test/functional/detrend_test.py index d278e1bd95a84956bde9da206c083af7731538b7..e05f2d2f040c9c5e80352bf74072a1c5432d13c2 100644 --- a/src/micado/test/functional/detrend_test.py +++ b/src/micado/test/functional/detrend_test.py @@ -28,7 +28,6 @@ from .masterdark_test import create_masterdark def test_processing(): """Test processing of Detrend.""" - Env["use_python_logging"] = True mymasterdark, dark_real, myraws_raw = create_masterdark() # TODO: Do not reuse the MasterDark as MasterFlat. diff --git a/src/micado/test/functional/flat_test.py b/src/micado/test/functional/flat_test.py index 731b72678d9a509a7161aa2af63661c29dd0d5c9..406dabb1c02e7f83501fe0e496be898263ee8381 100644 --- a/src/micado/test/functional/flat_test.py +++ b/src/micado/test/functional/flat_test.py @@ -78,7 +78,6 @@ def generate_flat(dark: float = 2.0, size: int = 32): def test_flat(): """Test creation of a Flat.""" - Env["use_python_logging"] = True dark = 0.0 flat1 = generate_flat(dark=dark) diff --git a/src/micado/test/functional/masterdark_test.py b/src/micado/test/functional/masterdark_test.py index 77dd2ab51410cc83104b8b9a9947bcec40e9da1e..cafc8625544522c284ae245a4d783eaa849d4cc3 100644 --- a/src/micado/test/functional/masterdark_test.py +++ b/src/micado/test/functional/masterdark_test.py @@ -143,7 +143,6 @@ def compare_pros(dataitem1: Img, dataitem2: Img): def test_processing(): """Test creation of MasterDark.""" - Env["use_python_logging"] = True mymasterdark, dark_real, mydarks_raw = create_masterdark() # Create image statistics. @@ -188,7 +187,6 @@ def test_processing(): def test_none_mobject_fits(): """Test an '' reference in a FITS file.""" - Env["use_python_logging"] = True masterdark1, _, mydarks_raw = create_masterdark(simple=True) diff --git a/src/micado/test/functional/masterflat_test.py b/src/micado/test/functional/masterflat_test.py index c59dae7b9534ba0e417fbfda82ff33920ed2787a..7db89718cf4725d119f8dec9c48cbab81f7095b8 100644 --- a/src/micado/test/functional/masterflat_test.py +++ b/src/micado/test/functional/masterflat_test.py @@ -65,7 +65,6 @@ def create_masterflat(simple: bool = False): def test_processing(): """Test creation of MasterFlat.""" - Env["use_python_logging"] = True mymasterflat, myflats_raw, mydarks = create_masterflat() # Create image statistics. diff --git a/src/micado/test/functional/mdbobject_test.py b/src/micado/test/functional/mdbobject_test.py index 3641f255f0279721209b0759d2786c7606b1b127..c2c34c55c76d8c0b9cacee7bcd29c9a411086b63 100644 --- a/src/micado/test/functional/mdbobject_test.py +++ b/src/micado/test/functional/mdbobject_test.py @@ -9,8 +9,6 @@ from micado.hardware.Detector import Detector def test_getraw(): """Test getting raw dataproducts.""" - Env["use_python_logging"] = True - assert MasterDark.get_raw_attr_class() == ("darks", Dark) assert Dark.get_raw_class() == Dark assert Detector.get_raw_attr_class() == (None, None) diff --git a/src/micado/test/functional/science_test.py b/src/micado/test/functional/science_test.py index 1459c69d11ab7541b110637cbe59bf9ae509f15a..bd330a6ce0c19cfd7ef2604b9de4fb1d894a1d54 100644 --- a/src/micado/test/functional/science_test.py +++ b/src/micado/test/functional/science_test.py @@ -175,7 +175,6 @@ def get_science(size=32, dark_current=100): def test_science(): """Test creation of a Raw Science image.""" - Env["use_python_logging"] = True science1 = get_science() science1.make_simulation() @@ -215,7 +214,6 @@ def test_science(): def test_science_multi(): """Test creation of a multi-extension raw image.""" - Env["use_python_logging"] = True # Set the dark current and create a DetectorArray. dark_current = 100.0 mydarkcurrent = DarkCurrent(value=dark_current) diff --git a/src/micado/test/functional/stack_test.py b/src/micado/test/functional/stack_test.py index a86aacdb11df5ba93a4bfa676a25b9722a2b1da1..b5659b12b697f4db27c2720a1600be1cc977aae7 100644 --- a/src/micado/test/functional/stack_test.py +++ b/src/micado/test/functional/stack_test.py @@ -31,7 +31,6 @@ from micado.test.functional.science_test import get_filt_inst_ro, get_atmo_teles ) def test_stack(): """Test stacking of images.""" - Env["use_python_logging"] = True scopesim.server.download_package("telescopes/ELT") scopesim.server.download_package("instruments/MICADO")