From db8597a742d3bee2abde8286c1e628c21bfc1114 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 26 Apr 2024 02:12:36 +0200 Subject: [PATCH] Reduce scope of JSON/XML test fixtures (#116197) --- tests/components/airnow/conftest.py | 2 +- tests/components/airvisual_pro/conftest.py | 2 +- tests/components/awair/conftest.py | 22 +-- tests/components/blueprint/test_importer.py | 2 +- tests/components/evil_genius_labs/conftest.py | 6 +- tests/components/hue/conftest.py | 2 +- tests/components/insteon/test_api_aldb.py | 2 +- .../components/insteon/test_api_properties.py | 4 +- tests/components/insteon/test_api_scenes.py | 2 +- tests/components/mysensors/conftest.py | 38 +++--- tests/components/myuplink/conftest.py | 4 +- tests/components/plex/conftest.py | 128 +++++++++--------- tests/components/sensibo/conftest.py | 2 +- tests/components/smhi/conftest.py | 4 +- tests/components/sonos/conftest.py | 2 +- tests/components/soundtouch/conftest.py | 32 ++--- tests/components/tradfri/conftest.py | 4 +- tests/components/yale_smart_alarm/conftest.py | 2 +- tests/components/zwave_js/conftest.py | 128 +++++++++--------- 19 files changed, 194 insertions(+), 194 deletions(-) diff --git a/tests/components/airnow/conftest.py b/tests/components/airnow/conftest.py index 1010a45b8fb..db4400f85d3 100644 --- a/tests/components/airnow/conftest.py +++ b/tests/components/airnow/conftest.py @@ -44,7 +44,7 @@ def options_fixture(hass): } -@pytest.fixture(name="data", scope="session") +@pytest.fixture(name="data", scope="package") def data_fixture(): """Define a fixture for response data.""" return json.loads(load_fixture("response.json", "airnow")) diff --git a/tests/components/airvisual_pro/conftest.py b/tests/components/airvisual_pro/conftest.py index 719b25b3cdf..c90eb432c25 100644 --- a/tests/components/airvisual_pro/conftest.py +++ b/tests/components/airvisual_pro/conftest.py @@ -56,7 +56,7 @@ def disconnect_fixture(): return AsyncMock() -@pytest.fixture(name="data", scope="session") +@pytest.fixture(name="data", scope="package") def data_fixture(): """Define an update coordinator data example.""" return json.loads(load_fixture("data.json", "airvisual_pro")) diff --git a/tests/components/awair/conftest.py b/tests/components/awair/conftest.py index ec15561cc05..91c3d31e35b 100644 --- a/tests/components/awair/conftest.py +++ b/tests/components/awair/conftest.py @@ -7,67 +7,67 @@ import pytest from tests.common import load_fixture -@pytest.fixture(name="cloud_devices", scope="session") +@pytest.fixture(name="cloud_devices", scope="package") def cloud_devices_fixture(): """Fixture representing devices returned by Awair Cloud API.""" return json.loads(load_fixture("awair/cloud_devices.json")) -@pytest.fixture(name="local_devices", scope="session") +@pytest.fixture(name="local_devices", scope="package") def local_devices_fixture(): """Fixture representing devices returned by Awair local API.""" return json.loads(load_fixture("awair/local_devices.json")) -@pytest.fixture(name="gen1_data", scope="session") +@pytest.fixture(name="gen1_data", scope="package") def gen1_data_fixture(): """Fixture representing data returned from Gen1 Awair device.""" return json.loads(load_fixture("awair/awair.json")) -@pytest.fixture(name="gen2_data", scope="session") +@pytest.fixture(name="gen2_data", scope="package") def gen2_data_fixture(): """Fixture representing data returned from Gen2 Awair device.""" return json.loads(load_fixture("awair/awair-r2.json")) -@pytest.fixture(name="glow_data", scope="session") +@pytest.fixture(name="glow_data", scope="package") def glow_data_fixture(): """Fixture representing data returned from Awair glow device.""" return json.loads(load_fixture("awair/glow.json")) -@pytest.fixture(name="mint_data", scope="session") +@pytest.fixture(name="mint_data", scope="package") def mint_data_fixture(): """Fixture representing data returned from Awair mint device.""" return json.loads(load_fixture("awair/mint.json")) -@pytest.fixture(name="no_devices", scope="session") +@pytest.fixture(name="no_devices", scope="package") def no_devicess_fixture(): """Fixture representing when no devices are found in Awair's cloud API.""" return json.loads(load_fixture("awair/no_devices.json")) -@pytest.fixture(name="awair_offline", scope="session") +@pytest.fixture(name="awair_offline", scope="package") def awair_offline_fixture(): """Fixture representing when Awair devices are offline.""" return json.loads(load_fixture("awair/awair-offline.json")) -@pytest.fixture(name="omni_data", scope="session") +@pytest.fixture(name="omni_data", scope="package") def omni_data_fixture(): """Fixture representing data returned from Awair omni device.""" return json.loads(load_fixture("awair/omni.json")) -@pytest.fixture(name="user", scope="session") +@pytest.fixture(name="user", scope="package") def user_fixture(): """Fixture representing the User object returned from Awair's Cloud API.""" return json.loads(load_fixture("awair/user.json")) -@pytest.fixture(name="local_data", scope="session") +@pytest.fixture(name="local_data", scope="package") def local_data_fixture(): """Fixture representing data returned from Awair local device.""" return json.loads(load_fixture("awair/awair-local.json")) diff --git a/tests/components/blueprint/test_importer.py b/tests/components/blueprint/test_importer.py index 76f3ff36d05..275ee08863e 100644 --- a/tests/components/blueprint/test_importer.py +++ b/tests/components/blueprint/test_importer.py @@ -13,7 +13,7 @@ from tests.common import load_fixture from tests.test_util.aiohttp import AiohttpClientMocker -@pytest.fixture(scope="session") +@pytest.fixture(scope="module") def community_post(): """Topic JSON with a codeblock marked as auto syntax.""" return load_fixture("blueprint/community_post.json") diff --git a/tests/components/evil_genius_labs/conftest.py b/tests/components/evil_genius_labs/conftest.py index 49092da75c7..3941917e130 100644 --- a/tests/components/evil_genius_labs/conftest.py +++ b/tests/components/evil_genius_labs/conftest.py @@ -10,20 +10,20 @@ from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry, load_fixture -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def all_fixture(): """Fixture data.""" data = json.loads(load_fixture("data.json", "evil_genius_labs")) return {item["name"]: item for item in data} -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def info_fixture(): """Fixture info.""" return json.loads(load_fixture("info.json", "evil_genius_labs")) -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def product_fixture(): """Fixture info.""" return {"productName": "Fibonacci256"} diff --git a/tests/components/hue/conftest.py b/tests/components/hue/conftest.py index f87faf6294b..ac827d42d95 100644 --- a/tests/components/hue/conftest.py +++ b/tests/components/hue/conftest.py @@ -136,7 +136,7 @@ def create_mock_api_v1(hass): return api -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def v2_resources_test_data(): """Load V2 resources mock data.""" return json.loads(load_fixture("hue/v2_resources.json")) diff --git a/tests/components/insteon/test_api_aldb.py b/tests/components/insteon/test_api_aldb.py index 4e0df12c6f1..c919e7a9d22 100644 --- a/tests/components/insteon/test_api_aldb.py +++ b/tests/components/insteon/test_api_aldb.py @@ -26,7 +26,7 @@ from tests.common import load_fixture from tests.typing import WebSocketGenerator -@pytest.fixture(name="aldb_data", scope="session") +@pytest.fixture(name="aldb_data", scope="module") def aldb_data_fixture(): """Load the controller state fixture data.""" return json.loads(load_fixture("insteon/aldb_data.json")) diff --git a/tests/components/insteon/test_api_properties.py b/tests/components/insteon/test_api_properties.py index d2a388929b5..74ef759006c 100644 --- a/tests/components/insteon/test_api_properties.py +++ b/tests/components/insteon/test_api_properties.py @@ -29,13 +29,13 @@ from tests.common import load_fixture from tests.typing import WebSocketGenerator -@pytest.fixture(name="kpl_properties_data", scope="session") +@pytest.fixture(name="kpl_properties_data", scope="module") def kpl_properties_data_fixture(): """Load the controller state fixture data.""" return json.loads(load_fixture("insteon/kpl_properties.json")) -@pytest.fixture(name="iolinc_properties_data", scope="session") +@pytest.fixture(name="iolinc_properties_data", scope="module") def iolinc_properties_data_fixture(): """Load the controller state fixture data.""" return json.loads(load_fixture("insteon/iolinc_properties.json")) diff --git a/tests/components/insteon/test_api_scenes.py b/tests/components/insteon/test_api_scenes.py index 04fc74c89d1..1b8d4d50f08 100644 --- a/tests/components/insteon/test_api_scenes.py +++ b/tests/components/insteon/test_api_scenes.py @@ -18,7 +18,7 @@ from tests.common import load_fixture from tests.typing import WebSocketGenerator -@pytest.fixture(name="scene_data", scope="session") +@pytest.fixture(name="scene_data", scope="module") def aldb_data_fixture(): """Load the controller state fixture data.""" return json.loads(load_fixture("insteon/scene_data.json")) diff --git a/tests/components/mysensors/conftest.py b/tests/components/mysensors/conftest.py index e18043fda1f..01d6f5d9620 100644 --- a/tests/components/mysensors/conftest.py +++ b/tests/components/mysensors/conftest.py @@ -206,7 +206,7 @@ def update_gateway_nodes( return nodes -@pytest.fixture(name="cover_node_binary_state", scope="session") +@pytest.fixture(name="cover_node_binary_state", scope="package") def cover_node_binary_state_fixture() -> dict: """Load the cover node state.""" return load_nodes_state("cover_node_binary_state.json") @@ -221,7 +221,7 @@ def cover_node_binary( return nodes[1] -@pytest.fixture(name="cover_node_percentage_state", scope="session") +@pytest.fixture(name="cover_node_percentage_state", scope="package") def cover_node_percentage_state_fixture() -> dict: """Load the cover node state.""" return load_nodes_state("cover_node_percentage_state.json") @@ -236,7 +236,7 @@ def cover_node_percentage( return nodes[1] -@pytest.fixture(name="door_sensor_state", scope="session") +@pytest.fixture(name="door_sensor_state", scope="package") def door_sensor_state_fixture() -> dict: """Load the door sensor state.""" return load_nodes_state("door_sensor_state.json") @@ -249,7 +249,7 @@ def door_sensor(gateway_nodes: dict[int, Sensor], door_sensor_state: dict) -> Se return nodes[1] -@pytest.fixture(name="gps_sensor_state", scope="session") +@pytest.fixture(name="gps_sensor_state", scope="package") def gps_sensor_state_fixture() -> dict: """Load the gps sensor state.""" return load_nodes_state("gps_sensor_state.json") @@ -262,7 +262,7 @@ def gps_sensor(gateway_nodes: dict[int, Sensor], gps_sensor_state: dict) -> Sens return nodes[1] -@pytest.fixture(name="dimmer_node_state", scope="session") +@pytest.fixture(name="dimmer_node_state", scope="package") def dimmer_node_state_fixture() -> dict: """Load the dimmer node state.""" return load_nodes_state("dimmer_node_state.json") @@ -275,7 +275,7 @@ def dimmer_node(gateway_nodes: dict[int, Sensor], dimmer_node_state: dict) -> Se return nodes[1] -@pytest.fixture(name="hvac_node_auto_state", scope="session") +@pytest.fixture(name="hvac_node_auto_state", scope="package") def hvac_node_auto_state_fixture() -> dict: """Load the hvac node auto state.""" return load_nodes_state("hvac_node_auto_state.json") @@ -290,7 +290,7 @@ def hvac_node_auto( return nodes[1] -@pytest.fixture(name="hvac_node_cool_state", scope="session") +@pytest.fixture(name="hvac_node_cool_state", scope="package") def hvac_node_cool_state_fixture() -> dict: """Load the hvac node cool state.""" return load_nodes_state("hvac_node_cool_state.json") @@ -305,7 +305,7 @@ def hvac_node_cool( return nodes[1] -@pytest.fixture(name="hvac_node_heat_state", scope="session") +@pytest.fixture(name="hvac_node_heat_state", scope="package") def hvac_node_heat_state_fixture() -> dict: """Load the hvac node heat state.""" return load_nodes_state("hvac_node_heat_state.json") @@ -320,7 +320,7 @@ def hvac_node_heat( return nodes[1] -@pytest.fixture(name="power_sensor_state", scope="session") +@pytest.fixture(name="power_sensor_state", scope="package") def power_sensor_state_fixture() -> dict: """Load the power sensor state.""" return load_nodes_state("power_sensor_state.json") @@ -333,7 +333,7 @@ def power_sensor(gateway_nodes: dict[int, Sensor], power_sensor_state: dict) -> return nodes[1] -@pytest.fixture(name="rgb_node_state", scope="session") +@pytest.fixture(name="rgb_node_state", scope="package") def rgb_node_state_fixture() -> dict: """Load the rgb node state.""" return load_nodes_state("rgb_node_state.json") @@ -346,7 +346,7 @@ def rgb_node(gateway_nodes: dict[int, Sensor], rgb_node_state: dict) -> Sensor: return nodes[1] -@pytest.fixture(name="rgbw_node_state", scope="session") +@pytest.fixture(name="rgbw_node_state", scope="package") def rgbw_node_state_fixture() -> dict: """Load the rgbw node state.""" return load_nodes_state("rgbw_node_state.json") @@ -359,7 +359,7 @@ def rgbw_node(gateway_nodes: dict[int, Sensor], rgbw_node_state: dict) -> Sensor return nodes[1] -@pytest.fixture(name="energy_sensor_state", scope="session") +@pytest.fixture(name="energy_sensor_state", scope="package") def energy_sensor_state_fixture() -> dict: """Load the energy sensor state.""" return load_nodes_state("energy_sensor_state.json") @@ -374,7 +374,7 @@ def energy_sensor( return nodes[1] -@pytest.fixture(name="sound_sensor_state", scope="session") +@pytest.fixture(name="sound_sensor_state", scope="package") def sound_sensor_state_fixture() -> dict: """Load the sound sensor state.""" return load_nodes_state("sound_sensor_state.json") @@ -387,7 +387,7 @@ def sound_sensor(gateway_nodes: dict[int, Sensor], sound_sensor_state: dict) -> return nodes[1] -@pytest.fixture(name="distance_sensor_state", scope="session") +@pytest.fixture(name="distance_sensor_state", scope="package") def distance_sensor_state_fixture() -> dict: """Load the distance sensor state.""" return load_nodes_state("distance_sensor_state.json") @@ -402,7 +402,7 @@ def distance_sensor( return nodes[1] -@pytest.fixture(name="ir_transceiver_state", scope="session") +@pytest.fixture(name="ir_transceiver_state", scope="package") def ir_transceiver_state_fixture() -> dict: """Load the ir transceiver state.""" return load_nodes_state("ir_transceiver_state.json") @@ -417,7 +417,7 @@ def ir_transceiver( return nodes[1] -@pytest.fixture(name="relay_node_state", scope="session") +@pytest.fixture(name="relay_node_state", scope="package") def relay_node_state_fixture() -> dict: """Load the relay node state.""" return load_nodes_state("relay_node_state.json") @@ -430,7 +430,7 @@ def relay_node(gateway_nodes: dict[int, Sensor], relay_node_state: dict) -> Sens return nodes[1] -@pytest.fixture(name="temperature_sensor_state", scope="session") +@pytest.fixture(name="temperature_sensor_state", scope="package") def temperature_sensor_state_fixture() -> dict: """Load the temperature sensor state.""" return load_nodes_state("temperature_sensor_state.json") @@ -445,7 +445,7 @@ def temperature_sensor( return nodes[1] -@pytest.fixture(name="text_node_state", scope="session") +@pytest.fixture(name="text_node_state", scope="package") def text_node_state_fixture() -> dict: """Load the text node state.""" return load_nodes_state("text_node_state.json") @@ -458,7 +458,7 @@ def text_node(gateway_nodes: dict[int, Sensor], text_node_state: dict) -> Sensor return nodes[1] -@pytest.fixture(name="battery_sensor_state", scope="session") +@pytest.fixture(name="battery_sensor_state", scope="package") def battery_sensor_state_fixture() -> dict: """Load the battery sensor state.""" return load_nodes_state("battery_sensor_state.json") diff --git a/tests/components/myuplink/conftest.py b/tests/components/myuplink/conftest.py index e08dc4255be..3ecb7e08356 100644 --- a/tests/components/myuplink/conftest.py +++ b/tests/components/myuplink/conftest.py @@ -71,7 +71,7 @@ async def setup_credentials(hass: HomeAssistant) -> None: # Fixture group for device API endpoint. -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def load_device_file() -> str: """Fixture for loading device file.""" return load_fixture("device.json", DOMAIN) @@ -92,7 +92,7 @@ def load_systems_jv_file(load_systems_file: str) -> dict[str, Any]: return json_loads(load_systems_file) -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def load_systems_file() -> str: """Load fixture file for systems.""" return load_fixture("systems-2dev.json", DOMAIN) diff --git a/tests/components/plex/conftest.py b/tests/components/plex/conftest.py index 7e82b1c9d26..d00b8eb944b 100644 --- a/tests/components/plex/conftest.py +++ b/tests/components/plex/conftest.py @@ -29,253 +29,253 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]: yield mock_setup_entry -@pytest.fixture(name="album", scope="session") +@pytest.fixture(name="album", scope="package") def album_fixture(): """Load album payload and return it.""" return load_fixture("plex/album.xml") -@pytest.fixture(name="artist_albums", scope="session") +@pytest.fixture(name="artist_albums", scope="package") def artist_albums_fixture(): """Load artist's albums payload and return it.""" return load_fixture("plex/artist_albums.xml") -@pytest.fixture(name="children_20", scope="session") +@pytest.fixture(name="children_20", scope="package") def children_20_fixture(): """Load children payload for item 20 and return it.""" return load_fixture("plex/children_20.xml") -@pytest.fixture(name="children_30", scope="session") +@pytest.fixture(name="children_30", scope="package") def children_30_fixture(): """Load children payload for item 30 and return it.""" return load_fixture("plex/children_30.xml") -@pytest.fixture(name="children_200", scope="session") +@pytest.fixture(name="children_200", scope="package") def children_200_fixture(): """Load children payload for item 200 and return it.""" return load_fixture("plex/children_200.xml") -@pytest.fixture(name="children_300", scope="session") +@pytest.fixture(name="children_300", scope="package") def children_300_fixture(): """Load children payload for item 300 and return it.""" return load_fixture("plex/children_300.xml") -@pytest.fixture(name="empty_library", scope="session") +@pytest.fixture(name="empty_library", scope="package") def empty_library_fixture(): """Load an empty library payload and return it.""" return load_fixture("plex/empty_library.xml") -@pytest.fixture(name="empty_payload", scope="session") +@pytest.fixture(name="empty_payload", scope="package") def empty_payload_fixture(): """Load an empty payload and return it.""" return load_fixture("plex/empty_payload.xml") -@pytest.fixture(name="grandchildren_300", scope="session") +@pytest.fixture(name="grandchildren_300", scope="package") def grandchildren_300_fixture(): """Load grandchildren payload for item 300 and return it.""" return load_fixture("plex/grandchildren_300.xml") -@pytest.fixture(name="library_movies_all", scope="session") +@pytest.fixture(name="library_movies_all", scope="package") def library_movies_all_fixture(): """Load payload for all items in the movies library and return it.""" return load_fixture("plex/library_movies_all.xml") -@pytest.fixture(name="library_movies_metadata", scope="session") +@pytest.fixture(name="library_movies_metadata", scope="package") def library_movies_metadata_fixture(): """Load payload for metadata in the movies library and return it.""" return load_fixture("plex/library_movies_metadata.xml") -@pytest.fixture(name="library_movies_collections", scope="session") +@pytest.fixture(name="library_movies_collections", scope="package") def library_movies_collections_fixture(): """Load payload for collections in the movies library and return it.""" return load_fixture("plex/library_movies_collections.xml") -@pytest.fixture(name="library_tvshows_all", scope="session") +@pytest.fixture(name="library_tvshows_all", scope="package") def library_tvshows_all_fixture(): """Load payload for all items in the tvshows library and return it.""" return load_fixture("plex/library_tvshows_all.xml") -@pytest.fixture(name="library_tvshows_metadata", scope="session") +@pytest.fixture(name="library_tvshows_metadata", scope="package") def library_tvshows_metadata_fixture(): """Load payload for metadata in the TV shows library and return it.""" return load_fixture("plex/library_tvshows_metadata.xml") -@pytest.fixture(name="library_tvshows_collections", scope="session") +@pytest.fixture(name="library_tvshows_collections", scope="package") def library_tvshows_collections_fixture(): """Load payload for collections in the TV shows library and return it.""" return load_fixture("plex/library_tvshows_collections.xml") -@pytest.fixture(name="library_music_all", scope="session") +@pytest.fixture(name="library_music_all", scope="package") def library_music_all_fixture(): """Load payload for all items in the music library and return it.""" return load_fixture("plex/library_music_all.xml") -@pytest.fixture(name="library_music_metadata", scope="session") +@pytest.fixture(name="library_music_metadata", scope="package") def library_music_metadata_fixture(): """Load payload for metadata in the music library and return it.""" return load_fixture("plex/library_music_metadata.xml") -@pytest.fixture(name="library_music_collections", scope="session") +@pytest.fixture(name="library_music_collections", scope="package") def library_music_collections_fixture(): """Load payload for collections in the music library and return it.""" return load_fixture("plex/library_music_collections.xml") -@pytest.fixture(name="library_movies_sort", scope="session") +@pytest.fixture(name="library_movies_sort", scope="package") def library_movies_sort_fixture(): """Load sorting payload for movie library and return it.""" return load_fixture("plex/library_movies_sort.xml") -@pytest.fixture(name="library_tvshows_sort", scope="session") +@pytest.fixture(name="library_tvshows_sort", scope="package") def library_tvshows_sort_fixture(): """Load sorting payload for tvshow library and return it.""" return load_fixture("plex/library_tvshows_sort.xml") -@pytest.fixture(name="library_music_sort", scope="session") +@pytest.fixture(name="library_music_sort", scope="package") def library_music_sort_fixture(): """Load sorting payload for music library and return it.""" return load_fixture("plex/library_music_sort.xml") -@pytest.fixture(name="library_movies_filtertypes", scope="session") +@pytest.fixture(name="library_movies_filtertypes", scope="package") def library_movies_filtertypes_fixture(): """Load filtertypes payload for movie library and return it.""" return load_fixture("plex/library_movies_filtertypes.xml") -@pytest.fixture(name="library", scope="session") +@pytest.fixture(name="library", scope="package") def library_fixture(): """Load library payload and return it.""" return load_fixture("plex/library.xml") -@pytest.fixture(name="library_movies_size", scope="session") +@pytest.fixture(name="library_movies_size", scope="package") def library_movies_size_fixture(): """Load movie library size payload and return it.""" return load_fixture("plex/library_movies_size.xml") -@pytest.fixture(name="library_music_size", scope="session") +@pytest.fixture(name="library_music_size", scope="package") def library_music_size_fixture(): """Load music library size payload and return it.""" return load_fixture("plex/library_music_size.xml") -@pytest.fixture(name="library_tvshows_size", scope="session") +@pytest.fixture(name="library_tvshows_size", scope="package") def library_tvshows_size_fixture(): """Load tvshow library size payload and return it.""" return load_fixture("plex/library_tvshows_size.xml") -@pytest.fixture(name="library_tvshows_size_episodes", scope="session") +@pytest.fixture(name="library_tvshows_size_episodes", scope="package") def library_tvshows_size_episodes_fixture(): """Load tvshow library size in episodes payload and return it.""" return load_fixture("plex/library_tvshows_size_episodes.xml") -@pytest.fixture(name="library_tvshows_size_seasons", scope="session") +@pytest.fixture(name="library_tvshows_size_seasons", scope="package") def library_tvshows_size_seasons_fixture(): """Load tvshow library size in seasons payload and return it.""" return load_fixture("plex/library_tvshows_size_seasons.xml") -@pytest.fixture(name="library_sections", scope="session") +@pytest.fixture(name="library_sections", scope="package") def library_sections_fixture(): """Load library sections payload and return it.""" return load_fixture("plex/library_sections.xml") -@pytest.fixture(name="media_1", scope="session") +@pytest.fixture(name="media_1", scope="package") def media_1_fixture(): """Load media payload for item 1 and return it.""" return load_fixture("plex/media_1.xml") -@pytest.fixture(name="media_30", scope="session") +@pytest.fixture(name="media_30", scope="package") def media_30_fixture(): """Load media payload for item 30 and return it.""" return load_fixture("plex/media_30.xml") -@pytest.fixture(name="media_100", scope="session") +@pytest.fixture(name="media_100", scope="package") def media_100_fixture(): """Load media payload for item 100 and return it.""" return load_fixture("plex/media_100.xml") -@pytest.fixture(name="media_200", scope="session") +@pytest.fixture(name="media_200", scope="package") def media_200_fixture(): """Load media payload for item 200 and return it.""" return load_fixture("plex/media_200.xml") -@pytest.fixture(name="player_plexweb_resources", scope="session") +@pytest.fixture(name="player_plexweb_resources", scope="package") def player_plexweb_resources_fixture(): """Load resources payload for a Plex Web player and return it.""" return load_fixture("plex/player_plexweb_resources.xml") -@pytest.fixture(name="player_plexhtpc_resources", scope="session") +@pytest.fixture(name="player_plexhtpc_resources", scope="package") def player_plexhtpc_resources_fixture(): """Load resources payload for a Plex HTPC player and return it.""" return load_fixture("plex/player_plexhtpc_resources.xml") -@pytest.fixture(name="playlists", scope="session") +@pytest.fixture(name="playlists", scope="package") def playlists_fixture(): """Load payload for all playlists and return it.""" return load_fixture("plex/playlists.xml") -@pytest.fixture(name="playlist_500", scope="session") +@pytest.fixture(name="playlist_500", scope="package") def playlist_500_fixture(): """Load payload for playlist 500 and return it.""" return load_fixture("plex/playlist_500.xml") -@pytest.fixture(name="playqueue_created", scope="session") +@pytest.fixture(name="playqueue_created", scope="package") def playqueue_created_fixture(): """Load payload for playqueue creation response and return it.""" return load_fixture("plex/playqueue_created.xml") -@pytest.fixture(name="playqueue_1234", scope="session") +@pytest.fixture(name="playqueue_1234", scope="package") def playqueue_1234_fixture(): """Load payload for playqueue 1234 and return it.""" return load_fixture("plex/playqueue_1234.xml") -@pytest.fixture(name="plex_server_accounts", scope="session") +@pytest.fixture(name="plex_server_accounts", scope="package") def plex_server_accounts_fixture(): """Load payload accounts on the Plex server and return it.""" return load_fixture("plex/plex_server_accounts.xml") -@pytest.fixture(name="plex_server_base", scope="session") +@pytest.fixture(name="plex_server_base", scope="package") def plex_server_base_fixture(): """Load base payload for Plex server info and return it.""" return load_fixture("plex/plex_server_base.xml") -@pytest.fixture(name="plex_server_default", scope="session") +@pytest.fixture(name="plex_server_default", scope="package") def plex_server_default_fixture(plex_server_base): """Load default payload for Plex server info and return it.""" return plex_server_base.format( @@ -283,133 +283,133 @@ def plex_server_default_fixture(plex_server_base): ) -@pytest.fixture(name="plex_server_clients", scope="session") +@pytest.fixture(name="plex_server_clients", scope="package") def plex_server_clients_fixture(): """Load available clients payload for Plex server and return it.""" return load_fixture("plex/plex_server_clients.xml") -@pytest.fixture(name="plextv_account", scope="session") +@pytest.fixture(name="plextv_account", scope="package") def plextv_account_fixture(): """Load account info from plex.tv and return it.""" return load_fixture("plex/plextv_account.xml") -@pytest.fixture(name="plextv_resources", scope="session") +@pytest.fixture(name="plextv_resources", scope="package") def plextv_resources_fixture(): """Load single-server payload for plex.tv resources and return it.""" return load_fixture("plex/plextv_resources_one_server.xml") -@pytest.fixture(name="plextv_resources_two_servers", scope="session") +@pytest.fixture(name="plextv_resources_two_servers", scope="package") def plextv_resources_two_servers_fixture(): """Load two-server payload for plex.tv resources and return it.""" return load_fixture("plex/plextv_resources_two_servers.xml") -@pytest.fixture(name="plextv_shared_users", scope="session") +@pytest.fixture(name="plextv_shared_users", scope="package") def plextv_shared_users_fixture(): """Load payload for plex.tv shared users and return it.""" return load_fixture("plex/plextv_shared_users.xml") -@pytest.fixture(name="session_base", scope="session") +@pytest.fixture(name="session_base", scope="package") def session_base_fixture(): """Load the base session payload and return it.""" return load_fixture("plex/session_base.xml") -@pytest.fixture(name="session_default", scope="session") +@pytest.fixture(name="session_default", scope="package") def session_default_fixture(session_base): """Load the default session payload and return it.""" return session_base.format(user_id=1) -@pytest.fixture(name="session_new_user", scope="session") +@pytest.fixture(name="session_new_user", scope="package") def session_new_user_fixture(session_base): """Load the new user session payload and return it.""" return session_base.format(user_id=1001) -@pytest.fixture(name="session_photo", scope="session") +@pytest.fixture(name="session_photo", scope="package") def session_photo_fixture(): """Load a photo session payload and return it.""" return load_fixture("plex/session_photo.xml") -@pytest.fixture(name="session_plexweb", scope="session") +@pytest.fixture(name="session_plexweb", scope="package") def session_plexweb_fixture(): """Load a Plex Web session payload and return it.""" return load_fixture("plex/session_plexweb.xml") -@pytest.fixture(name="session_transient", scope="session") +@pytest.fixture(name="session_transient", scope="package") def session_transient_fixture(): """Load a transient session payload and return it.""" return load_fixture("plex/session_transient.xml") -@pytest.fixture(name="session_unknown", scope="session") +@pytest.fixture(name="session_unknown", scope="package") def session_unknown_fixture(): """Load a hypothetical unknown session payload and return it.""" return load_fixture("plex/session_unknown.xml") -@pytest.fixture(name="session_live_tv", scope="session") +@pytest.fixture(name="session_live_tv", scope="package") def session_live_tv_fixture(): """Load a Live TV session payload and return it.""" return load_fixture("plex/session_live_tv.xml") -@pytest.fixture(name="livetv_sessions", scope="session") +@pytest.fixture(name="livetv_sessions", scope="package") def livetv_sessions_fixture(): """Load livetv/sessions payload and return it.""" return load_fixture("plex/livetv_sessions.xml") -@pytest.fixture(name="security_token", scope="session") +@pytest.fixture(name="security_token", scope="package") def security_token_fixture(): """Load a security token payload and return it.""" return load_fixture("plex/security_token.xml") -@pytest.fixture(name="show_seasons", scope="session") +@pytest.fixture(name="show_seasons", scope="package") def show_seasons_fixture(): """Load a show's seasons payload and return it.""" return load_fixture("plex/show_seasons.xml") -@pytest.fixture(name="sonos_resources", scope="session") +@pytest.fixture(name="sonos_resources", scope="package") def sonos_resources_fixture(): """Load Sonos resources payload and return it.""" return load_fixture("plex/sonos_resources.xml") -@pytest.fixture(name="hubs", scope="session") +@pytest.fixture(name="hubs", scope="package") def hubs_fixture(): """Load hubs resource payload and return it.""" return load_fixture("plex/hubs.xml") -@pytest.fixture(name="hubs_music_library", scope="session") +@pytest.fixture(name="hubs_music_library", scope="package") def hubs_music_library_fixture(): """Load music library hubs resource payload and return it.""" return load_fixture("plex/hubs_library_section.xml") -@pytest.fixture(name="update_check_nochange", scope="session") +@pytest.fixture(name="update_check_nochange", scope="package") def update_check_fixture_nochange() -> str: """Load a no-change update resource payload and return it.""" return load_fixture("plex/release_nochange.xml") -@pytest.fixture(name="update_check_new", scope="session") +@pytest.fixture(name="update_check_new", scope="package") def update_check_fixture_new() -> str: """Load a changed update resource payload and return it.""" return load_fixture("plex/release_new.xml") -@pytest.fixture(name="update_check_new_not_updatable", scope="session") +@pytest.fixture(name="update_check_new_not_updatable", scope="package") def update_check_fixture_new_not_updatable() -> str: """Load a changed update resource payload (not updatable) and return it.""" return load_fixture("plex/release_new_not_updatable.xml") diff --git a/tests/components/sensibo/conftest.py b/tests/components/sensibo/conftest.py index d98b19c3833..1c835cd8001 100644 --- a/tests/components/sensibo/conftest.py +++ b/tests/components/sensibo/conftest.py @@ -74,7 +74,7 @@ def load_json_from_fixture(load_data: str) -> SensiboData: return json_data -@pytest.fixture(name="load_data", scope="session") +@pytest.fixture(name="load_data", scope="package") def load_data_from_fixture() -> str: """Load fixture with fixture data and return.""" return load_fixture("data.json", "sensibo") diff --git a/tests/components/smhi/conftest.py b/tests/components/smhi/conftest.py index df6a81a223d..62da5207565 100644 --- a/tests/components/smhi/conftest.py +++ b/tests/components/smhi/conftest.py @@ -7,13 +7,13 @@ from homeassistant.components.smhi.const import DOMAIN from tests.common import load_fixture -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def api_response(): """Return an API response.""" return load_fixture("smhi.json", DOMAIN) -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def api_response_lack_data(): """Return an API response.""" return load_fixture("smhi_short.json", DOMAIN) diff --git a/tests/components/sonos/conftest.py b/tests/components/sonos/conftest.py index 0eb9b497fbd..3da0dd5c983 100644 --- a/tests/components/sonos/conftest.py +++ b/tests/components/sonos/conftest.py @@ -587,7 +587,7 @@ def mock_get_source_ip(mock_get_source_ip): return mock_get_source_ip -@pytest.fixture(name="zgs_discovery", scope="session") +@pytest.fixture(name="zgs_discovery", scope="package") def zgs_discovery_fixture(): """Load ZoneGroupState discovery payload and return it.""" return load_fixture("sonos/zgs_discovery.xml") diff --git a/tests/components/soundtouch/conftest.py b/tests/components/soundtouch/conftest.py index c81d76072d7..5bfeeea5ec5 100644 --- a/tests/components/soundtouch/conftest.py +++ b/tests/components/soundtouch/conftest.py @@ -47,97 +47,97 @@ def device2_config() -> MockConfigEntry: ) -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_info() -> str: """Load SoundTouch device 1 info response and return it.""" return load_fixture("soundtouch/device1_info.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_aux() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_aux.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_bluetooth() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_bluetooth.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_radio() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_radio.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_standby() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_standby.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_upnp() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_upnp.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_now_playing_upnp_paused() -> str: """Load SoundTouch device 1 now_playing response and return it.""" return load_fixture("soundtouch/device1_now_playing_upnp_paused.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_presets() -> str: """Load SoundTouch device 1 presets response and return it.""" return load_fixture("soundtouch/device1_presets.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_volume() -> str: """Load SoundTouch device 1 volume response and return it.""" return load_fixture("soundtouch/device1_volume.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_volume_muted() -> str: """Load SoundTouch device 1 volume response and return it.""" return load_fixture("soundtouch/device1_volume_muted.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device1_zone_master() -> str: """Load SoundTouch device 1 getZone response and return it.""" return load_fixture("soundtouch/device1_getZone_master.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device2_info() -> str: """Load SoundTouch device 2 info response and return it.""" return load_fixture("soundtouch/device2_info.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device2_volume() -> str: """Load SoundTouch device 2 volume response and return it.""" return load_fixture("soundtouch/device2_volume.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device2_now_playing_standby() -> str: """Load SoundTouch device 2 now_playing response and return it.""" return load_fixture("soundtouch/device2_now_playing_standby.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def device2_zone_slave() -> str: """Load SoundTouch device 2 getZone response and return it.""" return load_fixture("soundtouch/device2_getZone_slave.xml") -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def zone_empty() -> str: """Load empty SoundTouch getZone response and return it.""" return load_fixture("soundtouch/getZone_empty.xml") diff --git a/tests/components/tradfri/conftest.py b/tests/components/tradfri/conftest.py index 9ddac769c1f..73cfea59ce1 100644 --- a/tests/components/tradfri/conftest.py +++ b/tests/components/tradfri/conftest.py @@ -96,13 +96,13 @@ def device( return device -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def air_purifier() -> str: """Return an air purifier response.""" return load_fixture("air_purifier.json", DOMAIN) -@pytest.fixture(scope="session") +@pytest.fixture(scope="package") def blind() -> str: """Return a blind response.""" return load_fixture("blind.json", DOMAIN) diff --git a/tests/components/yale_smart_alarm/conftest.py b/tests/components/yale_smart_alarm/conftest.py index 816fc922411..211367a2922 100644 --- a/tests/components/yale_smart_alarm/conftest.py +++ b/tests/components/yale_smart_alarm/conftest.py @@ -56,7 +56,7 @@ async def load_config_entry( return (config_entry, client) -@pytest.fixture(name="load_json", scope="session") +@pytest.fixture(name="load_json", scope="package") def load_json_from_fixture() -> dict[str, Any]: """Load fixture with json data and return.""" diff --git a/tests/components/zwave_js/conftest.py b/tests/components/zwave_js/conftest.py index dbf7357d4a0..db92b89cf81 100644 --- a/tests/components/zwave_js/conftest.py +++ b/tests/components/zwave_js/conftest.py @@ -241,19 +241,19 @@ def create_backup_fixture(): # State fixtures -@pytest.fixture(name="controller_state", scope="session") +@pytest.fixture(name="controller_state", scope="package") def controller_state_fixture(): """Load the controller state fixture data.""" return json.loads(load_fixture("zwave_js/controller_state.json")) -@pytest.fixture(name="controller_node_state", scope="session") +@pytest.fixture(name="controller_node_state", scope="package") def controller_node_state_fixture(): """Load the controller node state fixture data.""" return json.loads(load_fixture("zwave_js/controller_node_state.json")) -@pytest.fixture(name="version_state", scope="session") +@pytest.fixture(name="version_state", scope="package") def version_state_fixture(): """Load the version state fixture data.""" return { @@ -276,67 +276,67 @@ def log_config_state_fixture(): } -@pytest.fixture(name="config_entry_diagnostics", scope="session") +@pytest.fixture(name="config_entry_diagnostics", scope="package") def config_entry_diagnostics_fixture(): """Load the config entry diagnostics fixture data.""" return json.loads(load_fixture("zwave_js/config_entry_diagnostics.json")) -@pytest.fixture(name="config_entry_diagnostics_redacted", scope="session") +@pytest.fixture(name="config_entry_diagnostics_redacted", scope="package") def config_entry_diagnostics_redacted_fixture(): """Load the redacted config entry diagnostics fixture data.""" return json.loads(load_fixture("zwave_js/config_entry_diagnostics_redacted.json")) -@pytest.fixture(name="multisensor_6_state", scope="session") +@pytest.fixture(name="multisensor_6_state", scope="package") def multisensor_6_state_fixture(): """Load the multisensor 6 node state fixture data.""" return json.loads(load_fixture("zwave_js/multisensor_6_state.json")) -@pytest.fixture(name="ecolink_door_sensor_state", scope="session") +@pytest.fixture(name="ecolink_door_sensor_state", scope="package") def ecolink_door_sensor_state_fixture(): """Load the Ecolink Door/Window Sensor node state fixture data.""" return json.loads(load_fixture("zwave_js/ecolink_door_sensor_state.json")) -@pytest.fixture(name="hank_binary_switch_state", scope="session") +@pytest.fixture(name="hank_binary_switch_state", scope="package") def binary_switch_state_fixture(): """Load the hank binary switch node state fixture data.""" return json.loads(load_fixture("zwave_js/hank_binary_switch_state.json")) -@pytest.fixture(name="bulb_6_multi_color_state", scope="session") +@pytest.fixture(name="bulb_6_multi_color_state", scope="package") def bulb_6_multi_color_state_fixture(): """Load the bulb 6 multi-color node state fixture data.""" return json.loads(load_fixture("zwave_js/bulb_6_multi_color_state.json")) -@pytest.fixture(name="light_color_null_values_state", scope="session") +@pytest.fixture(name="light_color_null_values_state", scope="package") def light_color_null_values_state_fixture(): """Load the light color null values node state fixture data.""" return json.loads(load_fixture("zwave_js/light_color_null_values_state.json")) -@pytest.fixture(name="eaton_rf9640_dimmer_state", scope="session") +@pytest.fixture(name="eaton_rf9640_dimmer_state", scope="package") def eaton_rf9640_dimmer_state_fixture(): """Load the eaton rf9640 dimmer node state fixture data.""" return json.loads(load_fixture("zwave_js/eaton_rf9640_dimmer_state.json")) -@pytest.fixture(name="lock_schlage_be469_state", scope="session") +@pytest.fixture(name="lock_schlage_be469_state", scope="package") def lock_schlage_be469_state_fixture(): """Load the schlage lock node state fixture data.""" return json.loads(load_fixture("zwave_js/lock_schlage_be469_state.json")) -@pytest.fixture(name="lock_august_asl03_state", scope="session") +@pytest.fixture(name="lock_august_asl03_state", scope="package") def lock_august_asl03_state_fixture(): """Load the August Pro lock node state fixture data.""" return json.loads(load_fixture("zwave_js/lock_august_asl03_state.json")) -@pytest.fixture(name="climate_radio_thermostat_ct100_plus_state", scope="session") +@pytest.fixture(name="climate_radio_thermostat_ct100_plus_state", scope="package") def climate_radio_thermostat_ct100_plus_state_fixture(): """Load the climate radio thermostat ct100 plus node state fixture data.""" return json.loads( @@ -346,7 +346,7 @@ def climate_radio_thermostat_ct100_plus_state_fixture(): @pytest.fixture( name="climate_radio_thermostat_ct100_plus_different_endpoints_state", - scope="session", + scope="package", ) def climate_radio_thermostat_ct100_plus_different_endpoints_state_fixture(): """Load the thermostat fixture state with values on different endpoints. @@ -360,13 +360,13 @@ def climate_radio_thermostat_ct100_plus_different_endpoints_state_fixture(): ) -@pytest.fixture(name="climate_adc_t3000_state", scope="session") +@pytest.fixture(name="climate_adc_t3000_state", scope="package") def climate_adc_t3000_state_fixture(): """Load the climate ADC-T3000 node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_adc_t3000_state.json")) -@pytest.fixture(name="climate_airzone_aidoo_control_hvac_unit_state", scope="session") +@pytest.fixture(name="climate_airzone_aidoo_control_hvac_unit_state", scope="package") def climate_airzone_aidoo_control_hvac_unit_state_fixture(): """Load the climate Airzone Aidoo Control HVAC Unit state fixture data.""" return json.loads( @@ -374,37 +374,37 @@ def climate_airzone_aidoo_control_hvac_unit_state_fixture(): ) -@pytest.fixture(name="climate_danfoss_lc_13_state", scope="session") +@pytest.fixture(name="climate_danfoss_lc_13_state", scope="package") def climate_danfoss_lc_13_state_fixture(): """Load Danfoss (LC-13) electronic radiator thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_danfoss_lc_13_state.json")) -@pytest.fixture(name="climate_eurotronic_spirit_z_state", scope="session") +@pytest.fixture(name="climate_eurotronic_spirit_z_state", scope="package") def climate_eurotronic_spirit_z_state_fixture(): """Load the climate Eurotronic Spirit Z thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_eurotronic_spirit_z_state.json")) -@pytest.fixture(name="climate_heatit_z_trm6_state", scope="session") +@pytest.fixture(name="climate_heatit_z_trm6_state", scope="package") def climate_heatit_z_trm6_state_fixture(): """Load the climate HEATIT Z-TRM6 thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_heatit_z_trm6_state.json")) -@pytest.fixture(name="climate_heatit_z_trm3_state", scope="session") +@pytest.fixture(name="climate_heatit_z_trm3_state", scope="package") def climate_heatit_z_trm3_state_fixture(): """Load the climate HEATIT Z-TRM3 thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_heatit_z_trm3_state.json")) -@pytest.fixture(name="climate_heatit_z_trm2fx_state", scope="session") +@pytest.fixture(name="climate_heatit_z_trm2fx_state", scope="package") def climate_heatit_z_trm2fx_state_fixture(): """Load the climate HEATIT Z-TRM2fx thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/climate_heatit_z_trm2fx_state.json")) -@pytest.fixture(name="climate_heatit_z_trm3_no_value_state", scope="session") +@pytest.fixture(name="climate_heatit_z_trm3_no_value_state", scope="package") def climate_heatit_z_trm3_no_value_state_fixture(): """Load the climate HEATIT Z-TRM3 thermostat node w/no value state fixture data.""" return json.loads( @@ -412,134 +412,134 @@ def climate_heatit_z_trm3_no_value_state_fixture(): ) -@pytest.fixture(name="nortek_thermostat_state", scope="session") +@pytest.fixture(name="nortek_thermostat_state", scope="package") def nortek_thermostat_state_fixture(): """Load the nortek thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/nortek_thermostat_state.json")) -@pytest.fixture(name="srt321_hrt4_zw_state", scope="session") +@pytest.fixture(name="srt321_hrt4_zw_state", scope="package") def srt321_hrt4_zw_state_fixture(): """Load the climate HRT4-ZW / SRT321 / SRT322 thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/srt321_hrt4_zw_state.json")) -@pytest.fixture(name="chain_actuator_zws12_state", scope="session") +@pytest.fixture(name="chain_actuator_zws12_state", scope="package") def window_cover_state_fixture(): """Load the window cover node state fixture data.""" return json.loads(load_fixture("zwave_js/chain_actuator_zws12_state.json")) -@pytest.fixture(name="fan_generic_state", scope="session") +@pytest.fixture(name="fan_generic_state", scope="package") def fan_generic_state_fixture(): """Load the fan node state fixture data.""" return json.loads(load_fixture("zwave_js/fan_generic_state.json")) -@pytest.fixture(name="hs_fc200_state", scope="session") +@pytest.fixture(name="hs_fc200_state", scope="package") def hs_fc200_state_fixture(): """Load the HS FC200+ node state fixture data.""" return json.loads(load_fixture("zwave_js/fan_hs_fc200_state.json")) -@pytest.fixture(name="leviton_zw4sf_state", scope="session") +@pytest.fixture(name="leviton_zw4sf_state", scope="package") def leviton_zw4sf_state_fixture(): """Load the Leviton ZW4SF node state fixture data.""" return json.loads(load_fixture("zwave_js/leviton_zw4sf_state.json")) -@pytest.fixture(name="fan_honeywell_39358_state", scope="session") +@pytest.fixture(name="fan_honeywell_39358_state", scope="package") def fan_honeywell_39358_state_fixture(): """Load the fan node state fixture data.""" return json.loads(load_fixture("zwave_js/fan_honeywell_39358_state.json")) -@pytest.fixture(name="gdc_zw062_state", scope="session") +@pytest.fixture(name="gdc_zw062_state", scope="package") def motorized_barrier_cover_state_fixture(): """Load the motorized barrier cover node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_zw062_state.json")) -@pytest.fixture(name="iblinds_v2_state", scope="session") +@pytest.fixture(name="iblinds_v2_state", scope="package") def iblinds_v2_state_fixture(): """Load the iBlinds v2 node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_iblinds_v2_state.json")) -@pytest.fixture(name="iblinds_v3_state", scope="session") +@pytest.fixture(name="iblinds_v3_state", scope="package") def iblinds_v3_state_fixture(): """Load the iBlinds v3 node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_iblinds_v3_state.json")) -@pytest.fixture(name="qubino_shutter_state", scope="session") +@pytest.fixture(name="qubino_shutter_state", scope="package") def qubino_shutter_state_fixture(): """Load the Qubino Shutter node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_qubino_shutter_state.json")) -@pytest.fixture(name="aeotec_nano_shutter_state", scope="session") +@pytest.fixture(name="aeotec_nano_shutter_state", scope="package") def aeotec_nano_shutter_state_fixture(): """Load the Aeotec Nano Shutter node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_aeotec_nano_shutter_state.json")) -@pytest.fixture(name="fibaro_fgr222_shutter_state", scope="session") +@pytest.fixture(name="fibaro_fgr222_shutter_state", scope="package") def fibaro_fgr222_shutter_state_fixture(): """Load the Fibaro FGR222 node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_fibaro_fgr222_state.json")) -@pytest.fixture(name="fibaro_fgr223_shutter_state", scope="session") +@pytest.fixture(name="fibaro_fgr223_shutter_state", scope="package") def fibaro_fgr223_shutter_state_fixture(): """Load the Fibaro FGR223 node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_fibaro_fgr223_state.json")) -@pytest.fixture(name="merten_507801_state", scope="session") +@pytest.fixture(name="merten_507801_state", scope="package") def merten_507801_state_fixture(): """Load the Merten 507801 Shutter node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_merten_507801_state.json")) -@pytest.fixture(name="aeon_smart_switch_6_state", scope="session") +@pytest.fixture(name="aeon_smart_switch_6_state", scope="package") def aeon_smart_switch_6_state_fixture(): """Load the AEON Labs (ZW096) Smart Switch 6 node state fixture data.""" return json.loads(load_fixture("zwave_js/aeon_smart_switch_6_state.json")) -@pytest.fixture(name="ge_12730_state", scope="session") +@pytest.fixture(name="ge_12730_state", scope="package") def ge_12730_state_fixture(): """Load the GE 12730 node state fixture data.""" return json.loads(load_fixture("zwave_js/fan_ge_12730_state.json")) -@pytest.fixture(name="aeotec_radiator_thermostat_state", scope="session") +@pytest.fixture(name="aeotec_radiator_thermostat_state", scope="package") def aeotec_radiator_thermostat_state_fixture(): """Load the Aeotec Radiator Thermostat node state fixture data.""" return json.loads(load_fixture("zwave_js/aeotec_radiator_thermostat_state.json")) -@pytest.fixture(name="inovelli_lzw36_state", scope="session") +@pytest.fixture(name="inovelli_lzw36_state", scope="package") def inovelli_lzw36_state_fixture(): """Load the Inovelli LZW36 node state fixture data.""" return json.loads(load_fixture("zwave_js/inovelli_lzw36_state.json")) -@pytest.fixture(name="null_name_check_state", scope="session") +@pytest.fixture(name="null_name_check_state", scope="package") def null_name_check_state_fixture(): """Load the null name check node state fixture data.""" return json.loads(load_fixture("zwave_js/null_name_check_state.json")) -@pytest.fixture(name="lock_id_lock_as_id150_state", scope="session") +@pytest.fixture(name="lock_id_lock_as_id150_state", scope="package") def lock_id_lock_as_id150_state_fixture(): """Load the id lock id-150 lock node state fixture data.""" return json.loads(load_fixture("zwave_js/lock_id_lock_as_id150_state.json")) @pytest.fixture( - name="climate_radio_thermostat_ct101_multiple_temp_units_state", scope="session" + name="climate_radio_thermostat_ct101_multiple_temp_units_state", scope="package" ) def climate_radio_thermostat_ct101_multiple_temp_units_state_fixture(): """Load the climate multiple temp units node state fixture data.""" @@ -554,7 +554,7 @@ def climate_radio_thermostat_ct101_multiple_temp_units_state_fixture(): name=( "climate_radio_thermostat_ct100_mode_and_setpoint_on_different_endpoints_state" ), - scope="session", + scope="package", ) def climate_radio_thermostat_ct100_mode_and_setpoint_on_different_endpoints_state_fixture(): """Load climate device w/ mode+setpoint on diff endpoints node state fixture data.""" @@ -565,37 +565,37 @@ def climate_radio_thermostat_ct100_mode_and_setpoint_on_different_endpoints_stat ) -@pytest.fixture(name="vision_security_zl7432_state", scope="session") +@pytest.fixture(name="vision_security_zl7432_state", scope="package") def vision_security_zl7432_state_fixture(): """Load the vision security zl7432 switch node state fixture data.""" return json.loads(load_fixture("zwave_js/vision_security_zl7432_state.json")) -@pytest.fixture(name="zen_31_state", scope="session") +@pytest.fixture(name="zen_31_state", scope="package") def zem_31_state_fixture(): """Load the zen_31 node state fixture data.""" return json.loads(load_fixture("zwave_js/zen_31_state.json")) -@pytest.fixture(name="wallmote_central_scene_state", scope="session") +@pytest.fixture(name="wallmote_central_scene_state", scope="package") def wallmote_central_scene_state_fixture(): """Load the wallmote central scene node state fixture data.""" return json.loads(load_fixture("zwave_js/wallmote_central_scene_state.json")) -@pytest.fixture(name="ge_in_wall_dimmer_switch_state", scope="session") +@pytest.fixture(name="ge_in_wall_dimmer_switch_state", scope="package") def ge_in_wall_dimmer_switch_state_fixture(): """Load the ge in-wall dimmer switch node state fixture data.""" return json.loads(load_fixture("zwave_js/ge_in_wall_dimmer_switch_state.json")) -@pytest.fixture(name="aeotec_zw164_siren_state", scope="session") +@pytest.fixture(name="aeotec_zw164_siren_state", scope="package") def aeotec_zw164_siren_state_fixture(): """Load the aeotec zw164 siren node state fixture data.""" return json.loads(load_fixture("zwave_js/aeotec_zw164_siren_state.json")) -@pytest.fixture(name="lock_popp_electric_strike_lock_control_state", scope="session") +@pytest.fixture(name="lock_popp_electric_strike_lock_control_state", scope="package") def lock_popp_electric_strike_lock_control_state_fixture(): """Load the popp electric strike lock control node state fixture data.""" return json.loads( @@ -603,73 +603,73 @@ def lock_popp_electric_strike_lock_control_state_fixture(): ) -@pytest.fixture(name="fortrezz_ssa1_siren_state", scope="session") +@pytest.fixture(name="fortrezz_ssa1_siren_state", scope="package") def fortrezz_ssa1_siren_state_fixture(): """Load the fortrezz ssa1 siren node state fixture data.""" return json.loads(load_fixture("zwave_js/fortrezz_ssa1_siren_state.json")) -@pytest.fixture(name="fortrezz_ssa3_siren_state", scope="session") +@pytest.fixture(name="fortrezz_ssa3_siren_state", scope="package") def fortrezz_ssa3_siren_state_fixture(): """Load the fortrezz ssa3 siren node state fixture data.""" return json.loads(load_fixture("zwave_js/fortrezz_ssa3_siren_state.json")) -@pytest.fixture(name="zp3111_not_ready_state", scope="session") +@pytest.fixture(name="zp3111_not_ready_state", scope="package") def zp3111_not_ready_state_fixture(): """Load the zp3111 4-in-1 sensor not-ready node state fixture data.""" return json.loads(load_fixture("zwave_js/zp3111-5_not_ready_state.json")) -@pytest.fixture(name="zp3111_state", scope="session") +@pytest.fixture(name="zp3111_state", scope="package") def zp3111_state_fixture(): """Load the zp3111 4-in-1 sensor node state fixture data.""" return json.loads(load_fixture("zwave_js/zp3111-5_state.json")) -@pytest.fixture(name="express_controls_ezmultipli_state", scope="session") +@pytest.fixture(name="express_controls_ezmultipli_state", scope="package") def light_express_controls_ezmultipli_state_fixture(): """Load the Express Controls EZMultiPli node state fixture data.""" return json.loads(load_fixture("zwave_js/express_controls_ezmultipli_state.json")) -@pytest.fixture(name="lock_home_connect_620_state", scope="session") +@pytest.fixture(name="lock_home_connect_620_state", scope="package") def lock_home_connect_620_state_fixture(): """Load the Home Connect 620 lock node state fixture data.""" return json.loads(load_fixture("zwave_js/lock_home_connect_620_state.json")) -@pytest.fixture(name="switch_zooz_zen72_state", scope="session") +@pytest.fixture(name="switch_zooz_zen72_state", scope="package") def switch_zooz_zen72_state_fixture(): """Load the Zooz Zen72 switch node state fixture data.""" return json.loads(load_fixture("zwave_js/switch_zooz_zen72_state.json")) -@pytest.fixture(name="indicator_test_state", scope="session") +@pytest.fixture(name="indicator_test_state", scope="package") def indicator_test_state_fixture(): """Load the indicator CC test node state fixture data.""" return json.loads(load_fixture("zwave_js/indicator_test_state.json")) -@pytest.fixture(name="energy_production_state", scope="session") +@pytest.fixture(name="energy_production_state", scope="package") def energy_production_state_fixture(): """Load a mock node with energy production CC state fixture data.""" return json.loads(load_fixture("zwave_js/energy_production_state.json")) -@pytest.fixture(name="nice_ibt4zwave_state", scope="session") +@pytest.fixture(name="nice_ibt4zwave_state", scope="package") def nice_ibt4zwave_state_fixture(): """Load a Nice IBT4ZWAVE cover node state fixture data.""" return json.loads(load_fixture("zwave_js/cover_nice_ibt4zwave_state.json")) -@pytest.fixture(name="logic_group_zdb5100_state", scope="session") +@pytest.fixture(name="logic_group_zdb5100_state", scope="package") def logic_group_zdb5100_state_fixture(): """Load the Logic Group ZDB5100 node state fixture data.""" return json.loads(load_fixture("zwave_js/logic_group_zdb5100_state.json")) -@pytest.fixture(name="central_scene_node_state", scope="session") +@pytest.fixture(name="central_scene_node_state", scope="package") def central_scene_node_state_fixture(): """Load node with Central Scene CC node state fixture data.""" return json.loads(load_fixture("zwave_js/central_scene_node_state.json"))