Skip to content

Commit 5f87b62

Browse files
committed
Fix test
1 parent 90c10d4 commit 5f87b62

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

models/asymkey/ssh_key_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ import (
1414
"github.com/stretchr/testify/assert"
1515
)
1616

17-
func init() {
18-
setting.SetCustomPathAndConf("", "", "")
19-
setting.LoadForTest()
20-
}
21-
2217
func Test_SSHParsePublicKey(t *testing.T) {
2318
testCases := []struct {
2419
name string

models/unittest/testdb.go

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ func fatalTestError(fmtStr string, args ...interface{}) {
4242
// MainTest a reusable TestMain(..) function for unit tests that need to use a
4343
// test database. Creates the test database, and sets necessary settings.
4444
func MainTest(m *testing.M, pathToGiteaRoot string, fixtureFiles ...string) {
45+
setting.SetCustomPathAndConf("", "", "")
46+
setting.LoadForTest()
47+
4548
var err error
4649

4750
giteaRoot = pathToGiteaRoot

0 commit comments

Comments
 (0)