mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Add async test helper to timeout and provide a task_executor automatically (#6651)
* Initial commit Forked at:74655edebcParent branch: origin/master * Add async test helper to timeout and provide a task_executor automatically * simplify error message to avoid difference between CI and locally * forgot env var * Use runtime env var instead of build env var * Rename variable to SUBSTRATE_TEST_TIMEOUT * CLEANUP Forked at:74655edebcParent branch: origin/master * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Re-export from test-utils * Default value to 120 * fix wrong crate in ci * Revert "Default value to 120" This reverts commit 8e458717078b242ffce7d3c4f66241d76f075125. * Fix version * WIP Forked at:74655edebcParent branch: origin/master * WIP Forked at:74655edebcParent branch: origin/master * WIP Forked at:74655edebcParent branch: origin/master * remove feature flag * fix missing dependency * CLEANUP Forked at:74655edebcParent branch: origin/master * fix test * Removed autotests=false * Some doc... * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * WIP Forked at:74655edebcParent branch: origin/master * WIP Forked at:74655edebcParent branch: origin/master * Update test-utils/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,29 @@
|
||||
|
||||
//! Test utils
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use futures;
|
||||
/// Marks async function to be executed by an async runtime and provide a `TaskExecutor`, suitable
|
||||
/// to test environment.
|
||||
///
|
||||
/// # Requirements
|
||||
///
|
||||
/// You must have tokio in the `[dev-dependencies]` of your crate to use this macro.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #[substrate_test_utils::test]
|
||||
/// async fn basic_test(task_executor: TaskExecutor) {
|
||||
/// assert!(true);
|
||||
/// // create your node in here and use task_executor
|
||||
/// // then don't forget to gracefully shutdown your node before exit
|
||||
/// }
|
||||
/// ```
|
||||
pub use substrate_test_utils_derive::test;
|
||||
#[doc(hidden)]
|
||||
pub use tokio;
|
||||
|
||||
/// Panic when the vectors are different, without taking the order into account.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
Reference in New Issue
Block a user