From 052c527e4c8cafc576691fa49496d4397dca5a6a Mon Sep 17 00:00:00 2001 From: Luca Benci Date: Tue, 10 Oct 2017 22:52:57 +0200 Subject: [PATCH] Avoid explicit config monkeypatching --- tests/unit/commands/test_runners.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit/commands/test_runners.py b/tests/unit/commands/test_runners.py index daa8541e8..4497cb843 100644 --- a/tests/unit/commands/test_runners.py +++ b/tests/unit/commands/test_runners.py @@ -80,25 +80,23 @@ class TestCompletions: """Tests for completions.use_best_match.""" - def test_dont_use_best_match(self, config_stub, monkeypatch): + def test_dont_use_best_match(self, config_stub): """Test multiple completion options with use_best_match set to false. Should raise NoSuchCommandError """ config_stub.val.completion.use_best_match = False - monkeypatch.setattr('qutebrowser.config', config_stub) parser = runners.CommandParser(partial_match=True) with pytest.raises(cmdexc.NoSuchCommandError): result = parser.parse('do') - def test_use_best_match(self, config_stub, monkeypatch): + def test_use_best_match(self, config_stub): """Test multiple completion options with use_best_match set to true. The resulting command should be the best match """ config_stub.val.completion.use_best_match = True - monkeypatch.setattr('qutebrowser.config', config_stub) parser = runners.CommandParser(partial_match=True) result = parser.parse('do')