From 8b588d2635766396e1441786c4950247f512cdd9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 Mar 2018 07:39:20 +0100 Subject: tests: Add a yaml_config_stub fixture (cherry picked from commit c03ef10d54e2129d309ea5d6c40471efa105764e) --- tests/helpers/fixtures.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index f9f02ba8b..f8729d3f8 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -193,11 +193,15 @@ def configdata_init(): @pytest.fixture -def config_stub(stubs, monkeypatch, configdata_init, config_tmpdir): - """Fixture which provides a fake config object.""" - yaml_config = configfiles.YamlConfig() +def yaml_config_stub(config_tmpdir): + """Fixture which provides a YamlConfig object.""" + return configfiles.YamlConfig() + - conf = config.Config(yaml_config=yaml_config) +@pytest.fixture +def config_stub(stubs, monkeypatch, configdata_init, yaml_config_stub): + """Fixture which provides a fake config object.""" + conf = config.Config(yaml_config=yaml_config_stub) monkeypatch.setattr(config, 'instance', conf) container = config.ConfigContainer(conf) -- cgit v1.2.3-54-g00ecf