change: replace with assert err nil

This commit is contained in:
lilong.129
2025-03-05 22:33:17 +08:00
parent b298441eba
commit a6fce6a13b
8 changed files with 93 additions and 81 deletions

View File

@@ -5,6 +5,7 @@ import (
"testing"
hrp "github.com/httprunner/httprunner/v5"
"github.com/stretchr/testify/assert"
)
const (
@@ -155,20 +156,12 @@ var demoTestCaseWithoutPlugin = &hrp.TestCase{
func TestGenDemoTestCase(t *testing.T) {
err := demoTestCaseWithPlugin.Dump2JSON(demoTestCaseWithPluginJSONPath)
if err != nil {
t.Fatal()
}
assert.Nil(t, err)
err = demoTestCaseWithPlugin.Dump2YAML(demoTestCaseWithPluginYAMLPath)
if err != nil {
t.Fatal()
}
assert.Nil(t, err)
err = demoTestCaseWithoutPlugin.Dump2JSON(demoTestCaseWithoutPluginJSONPath)
if err != nil {
t.Fatal()
}
assert.Nil(t, err)
err = demoTestCaseWithoutPlugin.Dump2YAML(demoTestCaseWithoutPluginYAMLPath)
if err != nil {
t.Fatal()
}
assert.Nil(t, err)
}