Attribute Macro tokio_macros::test[][src]

#[test]
Expand description

Marks async function to be executed by runtime, suitable to test enviornment

Options:

  • core_threads=n - Sets core threads to n.
  • max_threads=n - Sets max threads to n.

Usage

Select runtime

#[tokio::test(core_threads = 1)]
async fn my_test() {
    assert!(true);
}

Using default

#[tokio::test]
async fn my_test() {
    assert!(true);
}