mirror of
https://github.com/home-assistant/core
synced 2024-09-06 10:29:55 +02:00
Remove unnecessary session scoping to several test fixtures (#80500)
Co-authored-by: Joakim Plate <elupus@ecce.se>
This commit is contained in:
parent
8a80ea2ed8
commit
1cf801afbc
@ -50,7 +50,7 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@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"))
|
||||
|
@ -28,7 +28,7 @@ def config_entry_fixture(hass, config):
|
||||
return entry
|
||||
|
||||
|
||||
@pytest.fixture(name="devices", scope="session")
|
||||
@pytest.fixture(name="devices", scope="package")
|
||||
def devices_fixture():
|
||||
"""Define devices data."""
|
||||
return json.loads(load_fixture("devices.json", "ambient_station"))
|
||||
@ -48,7 +48,7 @@ async def setup_ambient_station_fixture(hass, config, devices):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(name="station_data", scope="session")
|
||||
@pytest.fixture(name="station_data", scope="package")
|
||||
def station_data_fixture():
|
||||
"""Define devices data."""
|
||||
return json.loads(load_fixture("station_data.json", "ambient_station"))
|
||||
|
@ -32,31 +32,31 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_sensor_pair_dump", scope="session")
|
||||
@pytest.fixture(name="data_sensor_pair_dump", scope="package")
|
||||
def data_sensor_pair_dump_fixture():
|
||||
"""Define data from a successful sensor_pair_dump response."""
|
||||
return json.loads(load_fixture("sensor_pair_dump_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_sensor_pair_sensor", scope="session")
|
||||
@pytest.fixture(name="data_sensor_pair_sensor", scope="package")
|
||||
def data_sensor_pair_sensor_fixture():
|
||||
"""Define data from a successful sensor_pair_sensor response."""
|
||||
return json.loads(load_fixture("sensor_pair_sensor_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_sensor_paired_sensor_status", scope="session")
|
||||
@pytest.fixture(name="data_sensor_paired_sensor_status", scope="package")
|
||||
def data_sensor_paired_sensor_status_fixture():
|
||||
"""Define data from a successful sensor_paired_sensor_status response."""
|
||||
return json.loads(load_fixture("sensor_paired_sensor_status_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_system_diagnostics", scope="session")
|
||||
@pytest.fixture(name="data_system_diagnostics", scope="package")
|
||||
def data_system_diagnostics_fixture():
|
||||
"""Define data from a successful system_diagnostics response."""
|
||||
return json.loads(load_fixture("system_diagnostics_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_system_onboard_sensor_status", scope="session")
|
||||
@pytest.fixture(name="data_system_onboard_sensor_status", scope="package")
|
||||
def data_system_onboard_sensor_status_fixture():
|
||||
"""Define data from a successful system_onboard_sensor_status response."""
|
||||
return json.loads(
|
||||
@ -64,19 +64,19 @@ def data_system_onboard_sensor_status_fixture():
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(name="data_system_ping", scope="session")
|
||||
@pytest.fixture(name="data_system_ping", scope="package")
|
||||
def data_system_ping_fixture():
|
||||
"""Define data from a successful system_ping response."""
|
||||
return json.loads(load_fixture("system_ping_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_valve_status", scope="session")
|
||||
@pytest.fixture(name="data_valve_status", scope="package")
|
||||
def data_valve_status_fixture():
|
||||
"""Define data from a successful valve_status response."""
|
||||
return json.loads(load_fixture("valve_status_data.json", "guardian"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_wifi_status", scope="session")
|
||||
@pytest.fixture(name="data_wifi_status", scope="package")
|
||||
def data_wifi_status_fixture():
|
||||
"""Define data from a successful wifi_status response."""
|
||||
return json.loads(load_fixture("wifi_status_data.json", "guardian"))
|
||||
|
@ -26,43 +26,43 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_allergy_forecast", scope="session")
|
||||
@pytest.fixture(name="data_allergy_forecast", scope="package")
|
||||
def data_allergy_forecast_fixture():
|
||||
"""Define allergy forecast data."""
|
||||
return json.loads(load_fixture("allergy_forecast_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_allergy_index", scope="session")
|
||||
@pytest.fixture(name="data_allergy_index", scope="package")
|
||||
def data_allergy_index_fixture():
|
||||
"""Define allergy index data."""
|
||||
return json.loads(load_fixture("allergy_index_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_allergy_outlook", scope="session")
|
||||
@pytest.fixture(name="data_allergy_outlook", scope="package")
|
||||
def data_allergy_outlook_fixture():
|
||||
"""Define allergy outlook data."""
|
||||
return json.loads(load_fixture("allergy_outlook_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_asthma_forecast", scope="session")
|
||||
@pytest.fixture(name="data_asthma_forecast", scope="package")
|
||||
def data_asthma_forecast_fixture():
|
||||
"""Define asthma forecast data."""
|
||||
return json.loads(load_fixture("asthma_forecast_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_asthma_index", scope="session")
|
||||
@pytest.fixture(name="data_asthma_index", scope="package")
|
||||
def data_asthma_index_fixture():
|
||||
"""Define asthma index data."""
|
||||
return json.loads(load_fixture("asthma_index_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_disease_forecast", scope="session")
|
||||
@pytest.fixture(name="data_disease_forecast", scope="package")
|
||||
def data_disease_forecast_fixture():
|
||||
"""Define disease forecast data."""
|
||||
return json.loads(load_fixture("disease_forecast_data.json", "iqvia"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_disease_index", scope="session")
|
||||
@pytest.fixture(name="data_disease_index", scope="package")
|
||||
def data_disease_index_fixture():
|
||||
"""Define disease index data."""
|
||||
return json.loads(load_fixture("disease_index_data.json", "iqvia"))
|
||||
|
@ -38,19 +38,19 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_bridge", scope="session")
|
||||
@pytest.fixture(name="data_bridge", scope="package")
|
||||
def data_bridge_fixture():
|
||||
"""Define bridge data."""
|
||||
return json.loads(load_fixture("bridge_data.json", "notion"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_sensor", scope="session")
|
||||
@pytest.fixture(name="data_sensor", scope="package")
|
||||
def data_sensor_fixture():
|
||||
"""Define sensor data."""
|
||||
return json.loads(load_fixture("sensor_data.json", "notion"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_task", scope="session")
|
||||
@pytest.fixture(name="data_task", scope="package")
|
||||
def data_task_fixture():
|
||||
"""Define task data."""
|
||||
return json.loads(load_fixture("task_data.json", "notion"))
|
||||
|
@ -40,13 +40,13 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_protection_window", scope="session")
|
||||
@pytest.fixture(name="data_protection_window", scope="package")
|
||||
def data_protection_window_fixture():
|
||||
"""Define a fixture to return UV protection window data."""
|
||||
return json.loads(load_fixture("protection_window_data.json", "openuv"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_uv_index", scope="session")
|
||||
@pytest.fixture(name="data_uv_index", scope="package")
|
||||
def data_uv_index_fixture():
|
||||
"""Define a fixture to return UV index data."""
|
||||
return json.loads(load_fixture("uv_index_data.json", "openuv"))
|
||||
|
@ -76,19 +76,19 @@ def controller_mac_fixture():
|
||||
return "aa:bb:cc:dd:ee:ff"
|
||||
|
||||
|
||||
@pytest.fixture(name="data_api_versions", scope="session")
|
||||
@pytest.fixture(name="data_api_versions", scope="package")
|
||||
def data_api_versions_fixture():
|
||||
"""Define API version data."""
|
||||
return json.loads(load_fixture("api_versions_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_diagnostics_current", scope="session")
|
||||
@pytest.fixture(name="data_diagnostics_current", scope="package")
|
||||
def data_diagnostics_current_fixture():
|
||||
"""Define current diagnostics data."""
|
||||
return json.loads(load_fixture("diagnostics_current_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_machine_firmare_update_status", scope="session")
|
||||
@pytest.fixture(name="data_machine_firmare_update_status", scope="package")
|
||||
def data_machine_firmare_update_status_fixture():
|
||||
"""Define machine firmware update status data."""
|
||||
return json.loads(
|
||||
@ -96,31 +96,31 @@ def data_machine_firmare_update_status_fixture():
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(name="data_programs", scope="session")
|
||||
@pytest.fixture(name="data_programs", scope="package")
|
||||
def data_programs_fixture():
|
||||
"""Define program data."""
|
||||
return json.loads(load_fixture("programs_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_provision_settings", scope="session")
|
||||
@pytest.fixture(name="data_provision_settings", scope="package")
|
||||
def data_provision_settings_fixture():
|
||||
"""Define provisioning settings data."""
|
||||
return json.loads(load_fixture("provision_settings_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_restrictions_current", scope="session")
|
||||
@pytest.fixture(name="data_restrictions_current", scope="package")
|
||||
def data_restrictions_current_fixture():
|
||||
"""Define current restrictions settings data."""
|
||||
return json.loads(load_fixture("restrictions_current_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_restrictions_universal", scope="session")
|
||||
@pytest.fixture(name="data_restrictions_universal", scope="package")
|
||||
def data_restrictions_universal_fixture():
|
||||
"""Define universal restrictions settings data."""
|
||||
return json.loads(load_fixture("restrictions_universal_data.json", "rainmachine"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_zones", scope="session")
|
||||
@pytest.fixture(name="data_zones", scope="package")
|
||||
def data_zones_fixture():
|
||||
"""Define zone data."""
|
||||
return json.loads(load_fixture("zones_data.json", "rainmachine"))
|
||||
|
@ -58,25 +58,25 @@ def credentials_config_fixture():
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_latest_event", scope="session")
|
||||
@pytest.fixture(name="data_latest_event", scope="package")
|
||||
def data_latest_event_fixture():
|
||||
"""Define latest event data."""
|
||||
return json.loads(load_fixture("latest_event_data.json", "simplisafe"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_sensor", scope="session")
|
||||
@pytest.fixture(name="data_sensor", scope="package")
|
||||
def data_sensor_fixture():
|
||||
"""Define sensor data."""
|
||||
return json.loads(load_fixture("sensor_data.json", "simplisafe"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_settings", scope="session")
|
||||
@pytest.fixture(name="data_settings", scope="package")
|
||||
def data_settings_fixture():
|
||||
"""Define settings data."""
|
||||
return json.loads(load_fixture("settings_data.json", "simplisafe"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_subscription", scope="session")
|
||||
@pytest.fixture(name="data_subscription", scope="package")
|
||||
def data_subscription_fixture():
|
||||
"""Define subscription data."""
|
||||
return json.loads(load_fixture("subscription_data.json", "simplisafe"))
|
||||
|
@ -42,7 +42,7 @@ def config_fixture(hass):
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="data_tile_details", scope="session")
|
||||
@pytest.fixture(name="data_tile_details", scope="package")
|
||||
def data_tile_details_fixture():
|
||||
"""Define a Tile details data payload."""
|
||||
return json.loads(load_fixture("tile_details_data.json", "tile"))
|
||||
|
@ -80,13 +80,13 @@ def config_entry_fixture(hass, config_auth, config_coordinates):
|
||||
return entry
|
||||
|
||||
|
||||
@pytest.fixture(name="data_grid_region", scope="session")
|
||||
@pytest.fixture(name="data_grid_region", scope="package")
|
||||
def data_grid_region_fixture():
|
||||
"""Define grid region data."""
|
||||
return json.loads(load_fixture("grid_region_data.json", "watttime"))
|
||||
|
||||
|
||||
@pytest.fixture(name="data_realtime_emissions", scope="session")
|
||||
@pytest.fixture(name="data_realtime_emissions", scope="package")
|
||||
def data_realtime_emissions_fixture():
|
||||
"""Define realtime emissions data."""
|
||||
return json.loads(load_fixture("realtime_emissions_data.json", "watttime"))
|
||||
|
Loading…
Reference in New Issue
Block a user