(&self, config: Config, func: F)
| 237 | } |
| 238 | |
| 239 | pub fn with_module<F>(&self, config: Config, func: F) |
| 240 | where |
| 241 | F: FnOnce(&Runtime, &ModuleHandle), |
| 242 | { |
| 243 | with_runtime(move |runtime| { |
| 244 | let module = runtime.block_on(async { self.load_module(config, None).await }); |
| 245 | let env = module.env.clone(); |
| 246 | let db_identity = module.db_identity; |
| 247 | let func_result = std::panic::catch_unwind(AssertUnwindSafe(|| func(runtime, &module))); |
| 248 | drop(module); |
| 249 | |
| 250 | runtime.block_on(async { finish_module_test(&env, db_identity, func_result).await }); |
| 251 | }); |
| 252 | } |
| 253 | |
| 254 | /// Load a module with the given config. |
| 255 | /// If "reuse_db_path" is set, the module will be loaded in the given path, |
nothing calls this directly
no test coverage detected