From 99e23922e6e1cdd2cce34e28a565d479e74bcfbe Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 19 Sep 2024 01:02:51 +0300 Subject: Fix the current-thread runtime tests w/ sqlx Tracked upstream as https://github.com/launchbadge/sqlx/issues/3510 --- src/database/postgres/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/database/postgres/mod.rs b/src/database/postgres/mod.rs index b705eed..8d67bb4 100644 --- a/src/database/postgres/mod.rs +++ b/src/database/postgres/mod.rs @@ -206,7 +206,10 @@ WHERE let new_post = { let mut post = old_post.clone(); + #[cfg(not(test))] // Tests use the current-thread runtime. tokio::task::block_in_place(|| f(&mut post)); + #[cfg(test)] + f(&mut post); post }; -- cgit 1.4.1