diff options
author | Vika <vika@fireburn.ru> | 2024-09-19 01:02:51 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-09-19 01:02:51 +0300 |
commit | 99e23922e6e1cdd2cce34e28a565d479e74bcfbe (patch) | |
tree | dcba71065c7b33a01a6edeeb844ad645ae7fa377 /src/database/postgres | |
parent | 2b01ce151272edc85ff975c72780532f35d3b3f1 (diff) | |
download | kittybox-99e23922e6e1cdd2cce34e28a565d479e74bcfbe.tar.zst |
Fix the current-thread runtime tests w/ sqlx
Tracked upstream as https://github.com/launchbadge/sqlx/issues/3510
Diffstat (limited to 'src/database/postgres')
-rw-r--r-- | src/database/postgres/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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 }; |