From 1cfec24ac22492408c69a571159e908c66dd0f00 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 2 Jan 2020 23:17:32 +0800 Subject: [PATCH] fix moulinette cli _do_authenticate --- test/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/conftest.py b/test/conftest.py index c256d1be..23c4523c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -128,7 +128,7 @@ def moulinette_webapi(moulinette): @pytest.fixture -def moulinette_cli(moulinette): +def moulinette_cli(moulinette, mocker): # Dirty hack needed, otherwise cookies ain't reused between request .. not # sure why :| import argparse @@ -137,10 +137,12 @@ def moulinette_cli(moulinette): action='store_true', default=False, help="Log and print debug messages", ) + mocker.patch("os.isatty", return_value=True) moulinette_cli = moulinette.core.init_interface( "cli", actionsmap={"namespaces": ["moulitest"], "use_cache": False, "parser_kwargs": {'top_parser': parser}}, ) + mocker.stopall() return moulinette_cli