Reduce scope of bluetooth test fixtures (#116210)

pull/116264/head
Erik Montnemery 2024-04-26 16:03:49 +02:00 committed by GitHub
parent e909074dfb
commit c9301850be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -8,21 +8,21 @@ import habluetooth.util as habluetooth_utils
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():
"""Mock the bluez manager socket."""
with patch.object(bleak_manager, "get_global_bluez_manager_with_timeout"):
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():
"""Mock the dbus message bus to avoid creating a socket."""
with patch.object(message_bus, "MessageBus"):
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():
"""Mock out auto recovery."""
with patch.object(habluetooth_utils, "recover_adapter"):