forked from forgejo/forgejo
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:
parent
e74a3b18af
commit
673cf6af76
55 changed files with 81 additions and 222 deletions
|
@ -4,7 +4,6 @@
|
|||
package webhook
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
|
@ -19,7 +18,6 @@ func TestMain(m *testing.M) {
|
|||
// for tests, allow only loopback IPs
|
||||
setting.Webhook.AllowedHostList = hostmatcher.MatchBuiltinLoopback
|
||||
unittest.MainTest(m, &unittest.TestOptions{
|
||||
GiteaRootPath: filepath.Join("..", ".."),
|
||||
SetUp: func() error {
|
||||
setting.LoadQueueSettings()
|
||||
return Init()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue