Add message_bridge fixture
This commit is contained in:
parent
965a2e2806
commit
552db64028
@ -35,7 +35,7 @@ pytest.register_assert_rewrite('helpers')
|
||||
|
||||
from helpers import logfail
|
||||
from helpers.logfail import fail_on_logging
|
||||
from helpers.messagemock import message_mock
|
||||
from helpers.messagemock import message_mock, message_bridge
|
||||
from helpers.fixtures import * # noqa: F403
|
||||
from qutebrowser.utils import qtutils, standarddir, usertypes, utils, version
|
||||
from qutebrowser.misc import objects
|
||||
|
@ -24,7 +24,7 @@ import logging
|
||||
import attr
|
||||
import pytest
|
||||
|
||||
from qutebrowser.utils import usertypes, message
|
||||
from qutebrowser.utils import usertypes, message, objreg
|
||||
|
||||
|
||||
@attr.s
|
||||
@ -90,3 +90,12 @@ def message_mock():
|
||||
mmock.patch()
|
||||
yield mmock
|
||||
mmock.unpatch()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def message_bridge(win_registry):
|
||||
"""Fixture to get a MessageBridge."""
|
||||
bridge = message.MessageBridge()
|
||||
objreg.register('message-bridge', bridge, scope='window', window=0)
|
||||
yield bridge
|
||||
objreg.delete('message-bridge', scope='window', window=0)
|
||||
|
Loading…
Reference in New Issue
Block a user