New issue
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
Recover in suite #695
Comments
P.S. |
+1 to this. With test suites that have some environmental setup/teardown, a panic will exit tests before the teardown can happen. Then you've got resources you have to clean up manually. Real-world example: I have a test suite that sets up a docker database container, then runs tests against it, and removes the container plus all volumes when everything is complete. If I have a panic in my code, I have to manually go through and clear out the container and its volumes. |
Merged |
IMHO, panic in tests is not a good idea. Not only because it's hard to understand what test panicked, but panic also crashes entire test run and some tests don't even start. I think it's a good idea to isolate each test run by putting a defer/recover so that you know exactly what test caused panic and give possibility for other tests to run.
Github PR implementing this feature: #696
The text was updated successfully, but these errors were encountered: