From 012f79b244bf0da17b00f0dc3332aaa070cad4f0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 5 Oct 2017 11:05:16 +0200 Subject: [PATCH] Make sure key_config_stub is available when needed --- tests/unit/config/test_configcommands.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 359a4b23a..96517d81c 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -263,7 +263,8 @@ class TestSource: """Test :config-source.""" - pytestmark = pytest.mark.usefixtures('config_tmpdir', 'data_tmpdir') + pytestmark = pytest.mark.usefixtures('config_tmpdir', 'data_tmpdir', + 'config_stub', 'key_config_stub') @pytest.mark.parametrize('use_default_dir', [True, False]) @pytest.mark.parametrize('clear', [True, False]) @@ -302,14 +303,17 @@ class TestEdit: """Tests for :config-edit.""" - def test_no_source(self, commands, mocker, config_tmpdir): + pytestmark = pytest.mark.usefixtures('config_tmpdir', 'data_tmpdir', + 'config_stub', 'key_config_stub') + + def test_no_source(self, commands, mocker): mock = mocker.patch('qutebrowser.config.configcommands.editor.' 'ExternalEditor._start_editor', autospec=True) commands.config_edit(no_source=True) mock.assert_called_once_with(unittest.mock.ANY) @pytest.fixture - def patch_editor(self, mocker, config_tmpdir, data_tmpdir): + def patch_editor(self, mocker): """Write a config.py file.""" def do_patch(text): def _write_file(editor_self):