Do not read config from os.Environ when running tests

Fixes #8655
This commit is contained in:
Bjørn Erik Pedersen
2021-06-16 18:58:40 +02:00
parent d392893cd7
commit 31fb29fb3f
3 changed files with 11 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
d.Environment = hugo.EnvironmentProduction
}
if len(d.Environ) == 0 {
if len(d.Environ) == 0 && !hugo.IsRunningAsTest() {
d.Environ = os.Environ()
}