test-go / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
24 stars 1 forks source link

Add suite variant for benchmarks #20

Open JelteF opened 6 years ago

JelteF commented 6 years ago

Copied from https://github.com/stretchr/testify/pull/495

I wanted setup, teardown and easy access to assert/require for benchmarks i'm working on. I think it might be useful for other people as well.

One thing I'm not sure about if we want to reuse the SetupTest, TearDownTest, BeforeTest and AfterTest interfaces or if new ones for Benchmark should be created. I kept it like this for now for sake of simplicity, but I don't mind adding the extra interfaces if it is decided that that improves clarity. If the interfaces are reused the documentation for them should at least be updated to include that they are run before and after benchmarks as well.