From 0e4719a0597ec9bf3bc6e914d10e575744951e80 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 20 Nov 2024 11:41:53 -0500 Subject: [PATCH 1/2] fix test_miri_mrs_badpix_selfcal_bkg --- jwst/regtest/test_miri_mrs_badpix_selfcal.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/jwst/regtest/test_miri_mrs_badpix_selfcal.py b/jwst/regtest/test_miri_mrs_badpix_selfcal.py index a65d0cbea4..39e5d8608f 100644 --- a/jwst/regtest/test_miri_mrs_badpix_selfcal.py +++ b/jwst/regtest/test_miri_mrs_badpix_selfcal.py @@ -59,22 +59,19 @@ def test_miri_mrs_badpix_selfcal(run_pipeline_selfcal, fitsdiff_default_kwargs): assert not os.path.isfile(fname) +@pytest.mark.parametrize("basename", ( + [f"{OUTSTEM_BKG}_badpix_selfcal.fits",] + + [f"{OUTSTEM_BKG}_badpix_selfcal_bkg_{idx}.fits" for idx in range(4)])) @pytest.mark.bigdata -def test_miri_mrs_badpix_selfcal_bkg(run_pipeline_background, fitsdiff_default_kwargs): +def test_miri_mrs_badpix_selfcal_bkg(basename, run_pipeline_background, fitsdiff_default_kwargs): """Run a test for MIRI MRS data with dedicated background exposures.""" rtdata = run_pipeline_background # Get the truth file - rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{OUTSTEM_BKG}_badpix_selfcal.fits") + rtdata.output = basename + rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{basename}") - # Compare the results + # Compare the results and heck the bkg files in the background case, but not in the selfcal case diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs) assert diff.identical, diff.report() - - # check the bkg files in the background case, but not in the selfcal case - for idx in range(4): - fname = f"{OUTSTEM_BKG}_badpix_selfcal_bkg_{idx}.fits" - truth = rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{fname}") - diff = FITSDiff(fname, truth, **fitsdiff_default_kwargs) - assert diff.identical, diff.report() From 5a2d0cd8ee5865f9e394c07b68d0fb1c84b6e6ec Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Wed, 20 Nov 2024 12:13:15 -0500 Subject: [PATCH 2/2] Update jwst/regtest/test_miri_mrs_badpix_selfcal.py --- jwst/regtest/test_miri_mrs_badpix_selfcal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwst/regtest/test_miri_mrs_badpix_selfcal.py b/jwst/regtest/test_miri_mrs_badpix_selfcal.py index 39e5d8608f..89fbbc864c 100644 --- a/jwst/regtest/test_miri_mrs_badpix_selfcal.py +++ b/jwst/regtest/test_miri_mrs_badpix_selfcal.py @@ -72,6 +72,6 @@ def test_miri_mrs_badpix_selfcal_bkg(basename, run_pipeline_background, fitsdiff rtdata.output = basename rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{basename}") - # Compare the results and heck the bkg files in the background case, but not in the selfcal case + # Compare the results and check the bkg files in the background case, but not in the selfcal case diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs) assert diff.identical, diff.report()