diff --git a/monkey/monkey_island/cc/test_island_logger.py b/monkey/monkey_island/cc/test_island_logger.py index ca7dfd704..a1cc27aa7 100644 --- a/monkey/monkey_island/cc/test_island_logger.py +++ b/monkey/monkey_island/cc/test_island_logger.py @@ -1,6 +1,8 @@ import logging import os +import pytest + from monkey_island.cc.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.island_logger import json_setup_logging @@ -9,16 +11,16 @@ TEST_LOGGER_CONFIG_PATH = os.path.join( ) -def set_home_env(monkeypatch, tmpdir): +# TODO move into monkey/monkey_island/cc/test_common/fixtures after rebase/backmerge +@pytest.fixture +def mock_home_env(monkeypatch, tmpdir): monkeypatch.setenv("HOME", str(tmpdir)) -def test_expanduser_filename(monkeypatch, tmpdir): +def test_expanduser_filename(mock_home_env, tmpdir): INFO_LOG = os.path.join(tmpdir, "info.log") TEST_STRING = "Hello, Monkey!" - set_home_env(monkeypatch, tmpdir) - json_setup_logging(TEST_LOGGER_CONFIG_PATH) logger = logging.getLogger("TestLogger")