Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If it's something that doesn't take too much wall time I just simply initialize those from scratch for every test. If I have multiple tests which need some complex setup I just put that down in a separate function and call that in every test. If it's something reaaally expensive to initialize I just use lazy_static:

https://crates.io/crates/lazy_static



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: