testify
testify copied to clipboard
suite: missing signature check before calling Test* method
If a test method on a suite has a parameter there is a panic:
func (suite *SomeTestSuite) TestUpdateSomething(somearg string) {
......
}
When running this you get the following panic:
suite.go:87: test panicked: reflect: Call with too few input arguments
....
I think the error handling could be more clear here. Something like "method TestUpdateSomething on SomeTestSuite contains arguments"
Here is the go.dev link: https://go.dev/play/p/cNNfqH5QpeQ
I can create a pull request if this change is wanted?
Edit: Some more context. I run into this problem when I am porting old test methods to a suite.