From 9b394e4111be30ab2191ff3d11cd317c4a168ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3ral?= Date: Mon, 13 Jun 2016 19:39:00 +0200 Subject: [PATCH] Use config_stub instead of monkeypatching config.get() --- tests/unit/commands/test_runners.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/unit/commands/test_runners.py b/tests/unit/commands/test_runners.py index ac6d989b4..10da730ae 100644 --- a/tests/unit/commands/test_runners.py +++ b/tests/unit/commands/test_runners.py @@ -43,13 +43,8 @@ class TestCommandRunner: with pytest.raises(cmdexc.NoSuchCommandError): list(cr.parse_all(cmdline_test.cmd, aliases=False)) - def test_parse_all_with_alias(self, cmdline_test, monkeypatch): - alias_dict = dict(alias_name=cmdline_test.cmd) - - def mock_get(section, *args, **kwargs): - assert section == "aliases" - return alias_dict.get(*args, **kwargs) - monkeypatch.setattr("qutebrowser.config.config.get", mock_get) + def test_parse_all_with_alias(self, cmdline_test, config_stub): + config_stub.data = {'aliases': {'alias_name': cmdline_test.cmd}} cr = runners.CommandRunner(0) if cmdline_test.valid: