mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 11:03:25 +00:00
Testify: move to require (#8122)
* Testify: move to require Moving testify to require to fail tests early in case of errors. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu> * More moves Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
3d8826a3d4
commit
6c56a1faaa
98 changed files with 6275 additions and 3282 deletions
|
@ -21,7 +21,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/prometheus/common/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/prometheus/prometheus/discovery/targetgroup"
|
||||
)
|
||||
|
@ -232,9 +232,9 @@ func TestGenerateTargetGroups(t *testing.T) {
|
|||
func TestWriteOutput(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
tmpfile, err := ioutil.TempFile("", "sd_adapter_test")
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmpfile.Name())
|
||||
tmpfile.Close()
|
||||
adapter := NewAdapter(ctx, tmpfile.Name(), "test_sd", nil, nil)
|
||||
assert.NoError(t, adapter.writeOutput())
|
||||
require.NoError(t, adapter.writeOutput())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue