Use mocker fixture instead of unittest.mock
As pointed out by @hackebrot
This commit is contained in:
parent
abc2c2b087
commit
a29b78e8ca
@ -377,12 +377,12 @@ class TestIsEditable:
|
||||
yield
|
||||
webelem.config = old_config
|
||||
|
||||
@pytest.yield_fixture
|
||||
def stub_config(self, stubs):
|
||||
@pytest.fixture
|
||||
def stub_config(self, stubs, mocker):
|
||||
"""Fixture to create a config stub with an input section."""
|
||||
config = stubs.ConfigStub({'input': {}})
|
||||
with mock.patch('qutebrowser.browser.webelem.config', new=config):
|
||||
yield config
|
||||
mocker.patch('qutebrowser.browser.webelem.config', new=config)
|
||||
return config
|
||||
|
||||
def test_input_plain(self):
|
||||
"""Test with plain input element."""
|
||||
|
Loading…
Reference in New Issue
Block a user