From eb0c52f2a7f38a6497e3240daa86fe47015ca522 Mon Sep 17 00:00:00 2001 From: Robert Pack Date: Sat, 27 Jan 2024 00:41:02 +0100 Subject: [PATCH] fix: cleanup paths created during tests --- crates/deltalake-core/src/table/builder.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/deltalake-core/src/table/builder.rs b/crates/deltalake-core/src/table/builder.rs index c5e9e8e0a6..c8aed3f791 100644 --- a/crates/deltalake-core/src/table/builder.rs +++ b/crates/deltalake-core/src/table/builder.rs @@ -450,8 +450,6 @@ mod tests { // parse an existing relative directory let uri = ensure_table_uri("."); assert!(uri.is_ok()); - let uri = ensure_table_uri("./nonexistent"); - assert!(uri.is_ok()); let uri = ensure_table_uri("s3://container/path"); assert!(uri.is_ok()); #[cfg(not(windows))] @@ -459,6 +457,10 @@ mod tests { let uri = ensure_table_uri("file:///tmp/nonexistent/some/path"); assert!(uri.is_ok()); } + let uri = ensure_table_uri("./nonexistent"); + assert!(uri.is_ok()); + let file_path = std::path::Path::new("./nonexistent"); + std::fs::remove_dir(file_path).unwrap(); // These cases should all roundtrip to themselves cfg_if::cfg_if! { @@ -535,7 +537,7 @@ mod tests { assert!(!relative_path.exists()); ensure_table_uri(relative_path.as_os_str().to_str().unwrap()).unwrap(); assert!(relative_path.exists()); - std::fs::remove_dir_all(relative_path).unwrap(); + std::fs::remove_dir_all(std::path::Path::new("_tmp")).unwrap(); } #[test]