mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Refactor tests (#26464)
1. Give the global variable clear names 2. Use generic parameter for `onGiteaRun`
This commit is contained in:
@@ -56,7 +56,7 @@ func TestSessionFileCreation(t *testing.T) {
|
||||
oldSessionConfig := setting.SessionConfig.ProviderConfig
|
||||
defer func() {
|
||||
setting.SessionConfig.ProviderConfig = oldSessionConfig
|
||||
c = routers.NormalRoutes()
|
||||
testWebRoutes = routers.NormalRoutes()
|
||||
}()
|
||||
|
||||
var config session.Options
|
||||
@@ -75,7 +75,7 @@ func TestSessionFileCreation(t *testing.T) {
|
||||
|
||||
setting.SessionConfig.ProviderConfig = string(newConfigBytes)
|
||||
|
||||
c = routers.NormalRoutes()
|
||||
testWebRoutes = routers.NormalRoutes()
|
||||
|
||||
t.Run("NoSessionOnViewIssue", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
Reference in New Issue
Block a user