Turns out msettings interface is None is ran from pytest because we bypass the usual moulinette init :/

This commit is contained in:
Alexandre Aubin 2021-01-03 23:53:00 +01:00
parent 9bf4a12f32
commit 9807b76d34
2 changed files with 2 additions and 4 deletions

View file

@ -401,9 +401,6 @@ def _hook_exec_bash(path, args, chdir, env, return_format, loggers):
_env = os.environ.copy()
_env.update(env)
# FIXME : this is a temporary debug to better understand why the test are failing on the CI but not when ran manually...
logger.warning(_env)
returncode = call_async_output(
cmd, loggers, shell=True, cwd=chdir,
stdinfo=stdinfo, env=_env

View file

@ -3,7 +3,7 @@ import pytest
import sys
import moulinette
from moulinette import m18n
from moulinette import m18n, msettings
from yunohost.utils.error import YunohostError
from contextlib import contextmanager
sys.path.append("..")
@ -78,3 +78,4 @@ def pytest_cmdline_main(config):
sys.path.insert(0, "/usr/lib/moulinette/")
import yunohost
yunohost.init(debug=config.option.yunodebug)
msettings["interface"] = "test"