diff options
author | TheFox0x7 <thefox0x7@gmail.com> | 2025-01-09 02:21:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 09:21:47 +0800 |
commit | 2a02734f93c0091275c77e370b7eed03b2c5f18e (patch) | |
tree | 2dcad43764cbfa254f7c6d355f5a14ffdcdb109a /modules/git/repo_language_stats_test.go | |
parent | fa9191b7b9373666f30a55bbc63b932833bceefe (diff) | |
download | gitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.tar.gz gitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.zip |
Refactor older tests to use testify (#33140)
Refactor checks to use assert/require
Use require.Eventually for waiting in elastic and meilisearch tests
Use require to exit early instead of assert
Diffstat (limited to 'modules/git/repo_language_stats_test.go')
-rw-r--r-- | modules/git/repo_language_stats_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/git/repo_language_stats_test.go b/modules/git/repo_language_stats_test.go index da3871e909..1ee5f4c3af 100644 --- a/modules/git/repo_language_stats_test.go +++ b/modules/git/repo_language_stats_test.go @@ -10,20 +10,18 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestRepository_GetLanguageStats(t *testing.T) { repoPath := filepath.Join(testReposDir, "language_stats_repo") gitRepo, err := openRepositoryWithDefaultContext(repoPath) - if !assert.NoError(t, err) { - t.Fatal() - } + require.NoError(t, err) + defer gitRepo.Close() stats, err := gitRepo.GetLanguageStats("8fee858da5796dfb37704761701bb8e800ad9ef3") - if !assert.NoError(t, err) { - t.Fatal() - } + require.NoError(t, err) assert.EqualValues(t, map[string]int64{ "Python": 134, |