mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
dev: refactor some test assertions (#4081)
This commit is contained in:
parent
615a52b9e3
commit
0704271d8d
11 changed files with 26 additions and 31 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/config"
|
||||
"github.com/golangci/golangci-lint/pkg/golinters"
|
||||
|
@ -173,9 +174,8 @@ func TestNolintInvalidLinterNameWithViolationOnTheSameLine(t *testing.T) {
|
|||
processedIssues, err := p.Process(issues)
|
||||
p.Finish()
|
||||
|
||||
assert.Len(t, processedIssues, 1)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, issues, processedIssues)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestNolintAliases(t *testing.T) {
|
||||
|
@ -288,7 +288,7 @@ func TestNolintUnused(t *testing.T) {
|
|||
enabledLintersSet := lintersdb.NewEnabledSet(dbManager, lintersdb.NewValidator(dbManager), enabledSetLog, cfg)
|
||||
|
||||
enabledLintersMap, err := enabledLintersSet.GetEnabledLintersMap()
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
return NewNolint(log, dbManager, enabledLintersMap)
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ func TestNolintUnused(t *testing.T) {
|
|||
enabledLintersSet := lintersdb.NewEnabledSet(dbManager, lintersdb.NewValidator(dbManager), enabledSetLog, cfg)
|
||||
|
||||
enabledLintersMap, err := enabledLintersSet.GetEnabledLintersMap()
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
p := NewNolint(log, dbManager, enabledLintersMap)
|
||||
defer p.Finish()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue