summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-03-12 07:39:20 +0100
committerFlorian Bruhin <git@the-compiler.org>2018-03-12 08:03:38 +0100
commit8b588d2635766396e1441786c4950247f512cdd9 (patch)
tree21d43d10c68e54702b950dfbe815e52065f1c736
parent9cab6403d45509a7c7dd49f52f12c1585168a0fa (diff)
downloadqutebrowser-8b588d2635766396e1441786c4950247f512cdd9.tar.gz
qutebrowser-8b588d2635766396e1441786c4950247f512cdd9.zip
tests: Add a yaml_config_stub fixture
(cherry picked from commit c03ef10d54e2129d309ea5d6c40471efa105764e)
-rw-r--r--tests/helpers/fixtures.py12
1 files 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)