File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,9 @@ where
298
298
/// Disable printing errors from Godot. Ideally we should catch and handle errors, ensuring they happen when
299
299
/// expected. But that isn't possible, so for now we can just disable printing the error to avoid spamming
300
300
/// the terminal when tests should error.
301
+ ///
302
+ /// **Important:** Do not run this inside [`expect_panic()`], it will mute panic messages forever. Instead, make sure [`suppress_godot_print()`]
303
+ /// is the outer function.
301
304
pub fn suppress_godot_print ( mut f : impl FnMut ( ) ) {
302
305
Engine :: singleton ( ) . set_print_error_messages ( false ) ;
303
306
f ( ) ;
Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ fn on_init_servers() {
110
110
fn on_init_scene ( ) {
111
111
// Known limitation that singletons only become available later:
112
112
// https://github.com/godotengine/godot-cpp/issues/1180#issuecomment-3074351805
113
- expect_panic ( "Singletons not loaded during Scene init level" , || {
114
- suppress_godot_print ( || {
113
+ suppress_godot_print ( || {
114
+ expect_panic ( "Singletons not loaded during Scene init level" , || {
115
115
let _ = godot:: classes:: RenderingServer :: singleton ( ) ;
116
116
} ) ;
117
117
} ) ;
You can’t perform that action at this time.
0 commit comments