def METHOD_NAME(pdict, tmp_path):
    dtype, shape, dim, metadata = (
        pdict["dtype"],
        pdict["shape"],
        pdict["dim"],
        pdict["metadata"],
    )
    s = _create_signal(shape=shape, dim=dim, dtype=dtype, metadata=metadata)
    filename = _get_filename(s, metadata)
    s.save(tmp_path / filename)
    s_just_saved = hs.load(tmp_path / filename)
    s_ref = hs.load(TEST_DATA_PATH / filename)
    try:
        for stest in (s_just_saved, s_ref):
            npt.assert_array_equal(s.data, stest.data)
            assert s.data.dtype == stest.data.dtype
            assert s.axes_manager.signal_shape == stest.axes_manager.signal_shape
            assert (
                s.axes_manager.navigation_shape == stest.axes_manager.navigation_shape
            )
            assert s.metadata.General.title == stest.metadata.General.title
            mdpaths = ("Signal.signal_type",)
            if s.metadata.Signal.signal_type == "EELS" and metadata:
                mdpaths += (
                    "Acquisition_instrument.TEM.convergence_angle",
                    "Acquisition_instrument.TEM.beam_energy",
                    "Acquisition_instrument.TEM.Detector.EELS.collection_angle",
                )
            elif "EDS" in s.metadata.Signal.signal_type and metadata:
                mdpaths += (
                    "Acquisition_instrument.TEM.Stage.tilt_alpha",
                    "Acquisition_instrument.TEM.Detector.EDS.azimuth_angle",
                    "Acquisition_instrument.TEM.Detector.EDS.elevation_angle",
                    "Acquisition_instrument.TEM.Detector." "EDS.energy_resolution_MnKa",
                    "Acquisition_instrument.TEM.Detector.EDS.live_time",
                )
            if metadata:
                mdpaths = (
                    "General.date",
                    "General.time",
                    "General.title",
                )
            for mdpath in mdpaths:
                assert s.metadata.get_item(mdpath) == stest.metadata.get_item(mdpath)
            for saxis, taxis in zip(s.axes_manager._axes, stest.axes_manager._axes):
                taxis.convert_to_units()
                assert saxis.scale == taxis.scale
                assert saxis.offset == taxis.offset
                assert saxis.units == taxis.units
                assert saxis.name == taxis.name
    except Exception:
        raise
    finally:
        # As of v0.8.5 the data in the ripple files are loaded as memmaps
        # instead of array. In Windows the garbage collector doesn't close
        # the file before attempting to delete it making the test fail.
        # The following lines simply make sure that the memmap is closed.
        # del s_just_saved.data
        # del s_ref.data
        del s_just_saved
        del s_ref
        gc.collect()