From 9807b76d3430aa74c917d360b12a52bf32634f70 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 3 Jan 2021 23:53:00 +0100 Subject: [PATCH] Turns out msettings interface is None is ran from pytest because we bypass the usual moulinette init :/ --- src/yunohost/hook.py | 3 --- src/yunohost/tests/conftest.py | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/yunohost/hook.py b/src/yunohost/hook.py index 3b899e0ad..8361b8505 100644 --- a/src/yunohost/hook.py +++ b/src/yunohost/hook.py @@ -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 diff --git a/src/yunohost/tests/conftest.py b/src/yunohost/tests/conftest.py index 2bda72852..1aaefb993 100644 --- a/src/yunohost/tests/conftest.py +++ b/src/yunohost/tests/conftest.py @@ -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"