We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example:
use rstest::*; struct SomeStruct {} impl std::ops::Drop for SomeStruct { fn drop(&mut self) { std::fs::File::create("got_dropped").unwrap(); } } #[fixture] #[once] fn value() -> SomeStruct { std::fs::File::create("got_created").unwrap(); SomeStruct {} } #[rstest] fn test1(value: &SomeStruct) { assert!(true); }
Running this test creates the "got_created" file but not the "got_dropped" file, indicating that the Drop implementation for SomeStruct was not run
The text was updated successfully, but these errors were encountered:
I'm sorry, but this is a well know limitation of this implementation (#119 (comment)). You can find a note about this at https://docs.rs/rstest/latest/rstest/attr.fixture.html#once-fixture . I think that there is no way to implement it without write a custom test runner that will make this crate harder to use.
Sorry, something went wrong.
ah I missed that note, fair enough
Might be worth adding to the readme though
No branches or pull requests
Example:
Running this test creates the "got_created" file but not the "got_dropped" file, indicating that the Drop implementation for SomeStruct was not run
The text was updated successfully, but these errors were encountered: