1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor testfixtures (#33028)

Partial backport of #33024
This commit is contained in:
wxiaoguang
2024-12-30 10:49:49 +08:00
committed by GitHub
parent 74159a8855
commit ce6a60a38b
8 changed files with 215 additions and 164 deletions

View File

@@ -13,9 +13,7 @@ import (
)
func TestMain(m *testing.M) {
unittest.MainTest(m, &unittest.TestOptions{
FixtureFiles: []string{""}, // load nothing
})
unittest.MainTest(m, &unittest.TestOptions{FixtureFiles: []string{ /* load nothing */ }})
}
type testItem1 struct {
@@ -36,8 +34,6 @@ func (*testItem2) Name() string {
}
func TestAppStateDB(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
as := &DBStore{}
item1 := new(testItem1)