Skip to content

Commit 6357d47

Browse files
committed
Fix accidental muting of panic messages in itest
1 parent 53aa677 commit 6357d47

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

itest/rust/src/framework/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ where
298298
/// Disable printing errors from Godot. Ideally we should catch and handle errors, ensuring they happen when
299299
/// expected. But that isn't possible, so for now we can just disable printing the error to avoid spamming
300300
/// 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.
301304
pub fn suppress_godot_print(mut f: impl FnMut()) {
302305
Engine::singleton().set_print_error_messages(false);
303306
f();

itest/rust/src/object_tests/init_level_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ fn on_init_servers() {
110110
fn on_init_scene() {
111111
// Known limitation that singletons only become available later:
112112
// 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", || {
115115
let _ = godot::classes::RenderingServer::singleton();
116116
});
117117
});

0 commit comments

Comments
 (0)