Attribute Macro integration_test

Source
#[integration_test]
Expand description

Integration test macros Usage: If you want add hooks to you integaration test, which need to create something before test, or remove something after test need add #integration_test macro after #test macro. If you add #integration_test you must add set_up(), and tear_down() hooks

Example:

#[cfg(test)] pub mod some_test { use super::*;

fn set_up() { println!(“Set up”); } fn tear_down() { println!(“Tear down”); }

#test #integration_test fn my_shiney_integration_test() { asserteq!(1, 2); } } Output order is: “Set up”, panic!() -> is going to show after tear_down finish “Tear down”