pub fn sequential<'a>() -> MutexGuard<'a, ()>
Expand description

Allow tests with global variables to run without interfering with each other. The lock is released when the MutexGuard variable goes out of scope.

Example

use common_testing::setup;

#[test]
fn test_1() {
 let _lock = setup::sequential();
 // test code
}

#[test]
fn test_2() {
 let _lock = setup::sequential();
 // test code
}

See Also

std::sync::Mutex::lock

std::sync::PoisonError