Skip to content

Commit 1eaa218

Browse files
committed
Fix deprecated env::set_var/remove_var in tests
Wrap all env::set_var and env::remove_var calls in unsafe blocks (deprecated as unsafe since Rust 1.81, will error on edition 2024). Add serial_test crate and #[serial] attribute to all tests that mutate environment variables to prevent parallel execution races. Fix XDG_CONFIG_HOME leak between tests by unsetting it in set_config_dir() helper. Tests now pass reliably with multi-threaded execution.
1 parent c907c3c commit 1eaa218

4 files changed

Lines changed: 170 additions & 26 deletions

File tree

Cargo.lock

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ serde = { version = "1.0", features = ["derive"] }
3131
serde_json = "1.0"
3232

3333
[dev-dependencies]
34+
serial_test = "3"
3435
tempfile = "3"

0 commit comments

Comments
 (0)