| 221 | } |
| 222 | |
| 223 | pub fn with_module_async<O, R, F>(&self, config: Config, routine: R) |
| 224 | where |
| 225 | R: FnOnce(ModuleHandle) -> F, |
| 226 | F: Future<Output = O>, |
| 227 | { |
| 228 | with_runtime(move |runtime| { |
| 229 | runtime.block_on(async { |
| 230 | let module = self.load_module(config, None).await; |
| 231 | let env = module.env.clone(); |
| 232 | let db_identity = module.db_identity; |
| 233 | let routine_result = AssertUnwindSafe(routine(module)).catch_unwind().await.map(drop); |
| 234 | finish_module_test(&env, db_identity, routine_result).await; |
| 235 | }); |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | pub fn with_module<F>(&self, config: Config, func: F) |
| 240 | where |