Open aesteve-rh opened 1 year ago
Add I mentioned in the documentation "Take care that the #[once]
fixture value will never be dropped." This limitation is due to that I have no idea of how to identify the end of the tests... :cry:
rstest
works on the top of standard cargo test
and cannot have any control on tests lifetime. On rust per 1.0 there was a way to register an on exit hook but it was removed lot of time ago.
If I find a way to register a call back is invocated at the end of all tests that will open a way to a lot of new functionalities.
Anyway I used some work around based on arc+mutex and some hysteresis to start and tear down some docker containers in integration tests... But it's not a general purpose solution.
Hi, thanks for this crate!
I am not sure if this can be actually done, but it would be great. Maybe with a new Attribute, something like
#[final]
?Let me explain with an example. If I use the
once
fixture
to set up an environment (e.g., create a folder and/or some files), it would be great to have them cleaned up only once, after a set of tests (all tests?) is done. Something like this: