]> source.dussan.org Git - gitea.git/commit
Replace assert.Fail with assert.FailNow (#27578)
authorNanguan Lin <70063547+lng2020@users.noreply.github.com>
Wed, 11 Oct 2023 11:02:24 +0000 (19:02 +0800)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 11:02:24 +0000 (11:02 +0000)
commitdc04044716088e3786497e200abe1fdfb3a943b6
tree45230f2067cbf0f130042e33eed36a38ed69e9b1
parentdca195e9bd0d14a5cf888524e51175da8ab24588
Replace assert.Fail with assert.FailNow (#27578)

assert.Fail() will continue to execute the code while assert.FailNow()
not. I thought those uses of assert.Fail() should exit immediately.
PS: perhaps it's a good idea to use
[require](https://pkg.go.dev/github.com/stretchr/testify/require)
somewhere because the assert package's default behavior does not exit
when an error occurs, which makes it difficult to find the root error
reason.
14 files changed:
models/asymkey/ssh_key_test.go
models/unittest/consistency.go
modules/contexttest/context_tests.go
modules/git/repo_attribute_test.go
modules/git/repo_tag_test.go
modules/indexer/code/indexer_test.go
modules/process/manager_test.go
services/pull/check_test.go
tests/integration/api_packages_conan_test.go
tests/integration/api_packages_container_test.go
tests/integration/api_packages_nuget_test.go
tests/integration/api_repo_test.go
tests/integration/api_token_test.go
tests/integration/gpg_git_test.go