pub trait AsyncTestLifecycleHook: Send + Sync {
// Provided methods
fn before_setup_async<'life0, 'life1, 'async_trait>(
&'life0 self,
_env: &'life1 TestEnv,
) -> Pin<Box<dyn Future<Output = TestingResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn after_setup_async<'life0, 'life1, 'async_trait>(
&'life0 self,
_env: &'life1 TestEnv,
) -> Pin<Box<dyn Future<Output = TestingResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn before_teardown_async<'life0, 'life1, 'async_trait>(
&'life0 self,
_env: &'life1 TestEnv,
) -> Pin<Box<dyn Future<Output = TestingResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn after_teardown_async<'life0, 'life1, 'async_trait>(
&'life0 self,
_env: &'life1 TestEnv,
) -> Pin<Box<dyn Future<Output = TestingResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
异步测试生命周期钩子 trait
定义测试环境在各个阶段执行的异步钩子函数,支持异步操作的初始化和清理。