From 3069c5aa5ae455d39fe948376cb505d19d448713 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Thu, 9 Apr 2026 16:51:19 +0200 Subject: [PATCH] fix(tests): skip config.save() in config_editor unit tests Tests using execute_action() triggered Config::save() with a default Config, silently overwriting ~/.config/owlry/config.toml on every `cargo test` run. Guard the save call with #[cfg(not(test))]. --- crates/owlry-core/src/providers/config_editor.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/owlry-core/src/providers/config_editor.rs b/crates/owlry-core/src/providers/config_editor.rs index ae6fd5e..e15cb56 100644 --- a/crates/owlry-core/src/providers/config_editor.rs +++ b/crates/owlry-core/src/providers/config_editor.rs @@ -70,6 +70,7 @@ impl ConfigProvider { false }; + #[cfg(not(test))] if result && let Err(e) = cfg.save() {