stretchr/testify tests don't mark pass/fail in the gutter

stretchr/testify Suite tests don't mark pass/fail in the gutter. Is it because I'm doing something wrong, or is it just not supported?

0
4 comments

Hi there! Do you mean something similar to what is shown in the screenshot here - https://www.jetbrains.com/help/go/using-the-testify-toolkit.html#run-tests-with-testify ? At first glance, this should be supported, however, if you can, could you please send us some code snippets so we could check this in more detail? Thank you!

0

Vadym,

Here's a simple example using the testify Suite package. (https://pkg.go.dev/github.com/stretchr/testify/suite)

Steve


package main

import (
	"testing"

	"github.com/stretchr/testify/suite"
)

type Suite struct {
	suite.Suite
}

func TestSuite(t *testing.T) {
	suite.Run(t, new(Suite))
}

func (s *Suite) Test_add() {
	tests := []struct {
		name string
		a    int
		b    int
		want int
	}{
		{
			name: "0+0",
			a:    0,
			b:    0,
			want: 0,
		},
		{
			name: "0+1",
			a:    0,
			b:    1,
			want: 1,
		},
	}
	for _, tt := range tests {
		s.Run(tt.name, func() {
			s.Equal(tt.want, add(tt.a, tt.b))
		})
	}
}

 

0

Hi Steven,

Indeed, I see what you mean now. Logged this as an issue on our end - GO-18018 . Please follow the case to get updated should there be any developments in this direction. Thank you!

0

Please sign in to leave a comment.