diff --git a/pkg/lockfile/parse-pylock_test.go b/pkg/lockfile/parse-pylock_test.go index 7bcefcd1..dd6d6930 100644 --- a/pkg/lockfile/parse-pylock_test.go +++ b/pkg/lockfile/parse-pylock_test.go @@ -1,6 +1,8 @@ package lockfile_test import ( + "errors" + "os" "testing" "github.com/g-rath/osv-detector/pkg/lockfile" @@ -11,7 +13,9 @@ func TestParsePylock_FileDoesNotExist(t *testing.T) { packages, err := lockfile.ParsePylock("testdata/pylock/does-not-exist") - expectErrContaining(t, err, "could not read") + if !errors.Is(err, os.ErrNotExist) { + t.Errorf("expected \"%v\" error but got \"%v\"", os.ErrNotExist, err) + } expectPackages(t, packages, []lockfile.PackageDetails{}) }