paralleltest icon indicating copy to clipboard operation
paralleltest copied to clipboard

False positive `Test` method inside a non test file

Open HTechHQ opened this issue 1 year ago • 1 comments

Hi there, I have a function func Test(t *testing.T) *MyStruct inside a normal .go file and not a _test.go file. The linter returns with Function Test missing the call to method parallel (paralleltest)

In my opinion this is a false positive, as the function is not part of the test package. In my specific case, I offer this method as a helper for my library and it's compiled inside the actual package for other developers to use in their code.

HTechHQ avatar Jul 22 '24 20:07 HTechHQ

Would you please be able to open a PR for a fix for this?

kunwardeep avatar Sep 16 '24 00:09 kunwardeep

This PR - fixed it - https://github.com/kunwardeep/paralleltest/pull/46

kunwardeep avatar Mar 27 '25 03:03 kunwardeep