Allow setup and teardown to return Result<()>
#[test] functions in rust can return a Result<()> to indicate a test failed. this is very convenient so you can use the ? operator.
When converting test functions to use test-context, this means if the setup function has ? statements, they have to be removed, or you have to wrap all the functions. For example, in lemmy we had to add this:
It would be very convenient if there was a way to return Result<(), anything> in async test context, so you don't have to use unwrap and a wrapper (which the linter does not like)
Hi @phiresky ! Sorry for the late reply, I just got to see it right now.
I will take a look into it and write back :)
Also if you want to contribute feel completely free to do so, I am very busy at the moment at work and moving to a different country so it might take a while for me to focus on this issue.
Thanks for reaching out, have a good end of the year :))
I'd close this as I don't find it necessary to return a result on tests, it should be fine to use "expect" or "unwrap" when testing