make writing main test easier (#27270)

This PR removed `unittest.MainTest` the second parameter
`TestOptions.GiteaRoot`. Now it detects the root directory by current
working directory.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao 2023-09-28 09:38:53 +08:00 committed by GitHub
parent e74a3b18af
commit 673cf6af76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 81 additions and 222 deletions

View file

@ -4,7 +4,6 @@
package gitdiff
import (
"path/filepath"
"testing"
"code.gitea.io/gitea/models/unittest"
@ -15,7 +14,5 @@ import (
)
func TestMain(m *testing.M) {
unittest.MainTest(m, &unittest.TestOptions{
GiteaRootPath: filepath.Join("..", ".."),
})
unittest.MainTest(m)
}