def METHOD_NAME(self):
    # We write a pre-scratch file.
    with open("pre_scratch_text", "w") as f:
        f.write("write")
    with ScratchDir(
        self.scratch_root,
        copy_from_current_on_enter=True,
        copy_to_current_on_exit=True,
        delete_removed_files=False,
    ) as d:
        with open("scratch_text", "w") as f:
            f.write("write")
        files = os.listdir(d)
        assert "scratch_text" in files
        assert "empty_file.txt" in files
        assert "pre_scratch_text" in files
        # We remove the pre-scratch file.
        os.remove("pre_scratch_text")
    # Make sure the tempdir is deleted.
    assert not os.path.exists(d)
    files = os.listdir(".")
    assert "scratch_text" in files
    # We check that the pre-scratch file DOES still exists
    assert "pre_scratch_text" in files
    os.remove("scratch_text")
    os.remove("pre_scratch_text")