Skip to content
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

suite: fix TestSubtestPanic failure (#1501) #1503

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion suite/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,14 @@ func (s *subtestPanicSuite) TearDownSubTest() {
}

func (s *subtestPanicSuite) TestSubtestPanic() {
s.Run("subtest", func() {
ok := s.Run("subtest", func() {
panic("panic")
})
// The panic must have the test reported as failed
if s.False(ok, "TestSubtestPanic/subtest failure is expected") {
// But we still want to success here, so just skip.
s.T().Skip("Subtest failure is expected")
}
}

func TestSubtestPanic(t *testing.T) {
Expand Down
Loading