mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Reduce scope of bluetooth test fixtures (#116210)
This commit is contained in:
parent
e909074dfb
commit
c9301850be
@ -8,21 +8,21 @@ import habluetooth.util as habluetooth_utils
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="disable_bluez_manager_socket", autouse=True, scope="session")
|
@pytest.fixture(name="disable_bluez_manager_socket", autouse=True, scope="package")
|
||||||
def disable_bluez_manager_socket():
|
def disable_bluez_manager_socket():
|
||||||
"""Mock the bluez manager socket."""
|
"""Mock the bluez manager socket."""
|
||||||
with patch.object(bleak_manager, "get_global_bluez_manager_with_timeout"):
|
with patch.object(bleak_manager, "get_global_bluez_manager_with_timeout"):
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="disable_dbus_socket", autouse=True, scope="session")
|
@pytest.fixture(name="disable_dbus_socket", autouse=True, scope="package")
|
||||||
def disable_dbus_socket():
|
def disable_dbus_socket():
|
||||||
"""Mock the dbus message bus to avoid creating a socket."""
|
"""Mock the dbus message bus to avoid creating a socket."""
|
||||||
with patch.object(message_bus, "MessageBus"):
|
with patch.object(message_bus, "MessageBus"):
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="disable_bluetooth_auto_recovery", autouse=True, scope="session")
|
@pytest.fixture(name="disable_bluetooth_auto_recovery", autouse=True, scope="package")
|
||||||
def disable_bluetooth_auto_recovery():
|
def disable_bluetooth_auto_recovery():
|
||||||
"""Mock out auto recovery."""
|
"""Mock out auto recovery."""
|
||||||
with patch.object(habluetooth_utils, "recover_adapter"):
|
with patch.object(habluetooth_utils, "recover_adapter"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user