Skip to content

Commit 1caf3ae

Browse files
committed
enforce signal handler setup to cleanup tempfiles on abort (#384)
1 parent a789490 commit 1caf3ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/tools/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ pub fn scripted_fixture_repo_read_only_with_args(
8888
script_name: impl AsRef<Path>,
8989
args: impl IntoIterator<Item = &'static str>,
9090
) -> Result<PathBuf> {
91+
// Assure tempfiles get removed when aborting the test.
92+
git_lock::tempfile::setup(
93+
git_lock::tempfile::SignalHandlerMode::DeleteTempfilesOnTerminationAndRestoreDefaultBehaviour,
94+
);
95+
9196
let script_location = script_name.as_ref();
9297
let script_path = fixture_path(script_location);
9398

0 commit comments

Comments
 (0)