From bc07c19961b889fbecbfea9f7bca43b6174cffdb Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 7 Jul 2022 08:15:21 +0000 Subject: [PATCH] Explain `tests::init` function --- ui_test/src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui_test/src/tests.rs b/ui_test/src/tests.rs index 13a242f8d8a7..11a3d6aca278 100644 --- a/ui_test/src/tests.rs +++ b/ui_test/src/tests.rs @@ -329,8 +329,8 @@ fn main() { } } -static INIT: std::sync::Once = std::sync::Once::new(); - +/// Call this from every test to initialize eyre only once across all tests. pub fn init() { + static INIT: std::sync::Once = std::sync::Once::new(); INIT.call_once(|| color_eyre::install().unwrap()); }