diff --git a/romancal/outlier_detection/tests/test_outlier_detection.py b/romancal/outlier_detection/tests/test_outlier_detection.py index be7901187..75127f000 100644 --- a/romancal/outlier_detection/tests/test_outlier_detection.py +++ b/romancal/outlier_detection/tests/test_outlier_detection.py @@ -1,3 +1,4 @@ +import gc import os import astropy.units as u @@ -80,6 +81,7 @@ def test_outlier_valid_input_asn(tmp_path, base_image, create_mock_asn_file): res.shelve(m, i, modify=False) del m del res + gc.collect(2) def test_outlier_valid_input_modelcontainer(tmp_path, base_image): diff --git a/romancal/tweakreg/tests/test_tweakreg.py b/romancal/tweakreg/tests/test_tweakreg.py index 9929e3393..565d961ee 100644 --- a/romancal/tweakreg/tests/test_tweakreg.py +++ b/romancal/tweakreg/tests/test_tweakreg.py @@ -557,6 +557,8 @@ def test_tweakreg_returns_modellibrary_on_association_file_as_input( for i, model in enumerate(res): assert model.meta.cal_step.tweakreg == "COMPLETE" res.shelve(model, i, modify=False) + del model + del res def test_tweakreg_returns_modellibrary_on_list_of_asdf_file_as_input( @@ -755,6 +757,8 @@ def test_tweakreg_combine_custom_catalogs_and_asn_file(tmp_path, base_image): assert (model.data == target.data).all() res.shelve(model, i, modify=False) + del model + del res @pytest.mark.parametrize( @@ -879,6 +883,8 @@ def test_tweakreg_parses_asn_correctly(tmp_path, base_image): assert (models[1].data == img_2.data).all() [res.shelve(m, i, modify=False) for i, m in enumerate(models)] + del models + del res def test_fit_results_in_meta(tmp_path, base_image):