The two delete-ordering tests did monkeypatch.chdir(tmp_path) and wrote the image under tmp_path/data/generated_images, but DATA_DIR (and therefore gallery_routes.GALLERY_IMAGE_DIR) is always an absolute path, so the delete resolver pointed at the repo's real data dir and ignored the chdir. test_file_removed_on_successful_delete therefore failed on dev (the file at the tmp path was never the one being removed), and test_file_kept_when_commit_fails passed only by accident. Set GALLERY_IMAGE_DIR to the seeded tmp dir via monkeypatch so both tests exercise the real path and pass deterministically.
3.4 KiB
3.4 KiB