From 51b0abdc4f7e457410f14c51734dda217fec9abb Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Thu, 16 May 2024 16:15:45 -0400 Subject: [PATCH] Fix failure in niriss tweakreg test --- jwst/regtest/test_niriss_image.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/jwst/regtest/test_niriss_image.py b/jwst/regtest/test_niriss_image.py index eb2a0ad70a..5be1f155d7 100644 --- a/jwst/regtest/test_niriss_image.py +++ b/jwst/regtest/test_niriss_image.py @@ -8,7 +8,6 @@ from jwst import datamodels from jwst.stpipe import Step -from jwst.tweakreg import TweakRegStep @pytest.fixture(scope="module") @@ -54,15 +53,25 @@ def test_niriss_tweakreg_no_sources(rtdata, fitsdiff_default_kwargs): rtdata.input = "niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json" rtdata.get_asn("niriss/imaging/jw01537-o003_20240406t164421_image3_00004_asn.json") - args = ["jwst.tweakreg.TweakRegStep", rtdata.input, "--abs_refcat='GAIADR3'"] + args = [ + "jwst.tweakreg.TweakRegStep", + rtdata.input, + "--abs_refcat='GAIADR3'", + "--save_results=True", + ] result = Step.from_cmdline(args) # Check that the step is skipped assert result.skip # Check the status of the step is set correctly in the files. - result = TweakRegStep.call(rtdata.input) - - for fi in result._models: + result = datamodels.ModelContainer( + rtdata.input, + return_open=False, + save_open=False + ) + + for fi in result: + fi = fi[:-5] + "_tweakreg" + fi[-5:] with datamodels.open(fi) as model: assert model.meta.cal_step.tweakreg == 'SKIPPED'