mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Move blocking code to executor job in MQTT CI test helper (#138815)
This commit is contained in:
parent
ee5e25aca6
commit
689421eddf
@ -1854,9 +1854,14 @@ async def help_test_reload_with_config(
|
||||
) -> None:
|
||||
"""Test reloading with supplied config."""
|
||||
new_yaml_config_file = tmp_path / "configuration.yaml"
|
||||
new_yaml_config = yaml.dump(config)
|
||||
new_yaml_config_file.write_text(new_yaml_config)
|
||||
assert new_yaml_config_file.read_text() == new_yaml_config
|
||||
|
||||
def _write_yaml_config() -> None:
|
||||
new_yaml_config = yaml.dump(config)
|
||||
new_yaml_config_file.write_text(new_yaml_config)
|
||||
assert new_yaml_config_file.read_text() == new_yaml_config
|
||||
return new_yaml_config
|
||||
|
||||
await hass.async_add_executor_job(_write_yaml_config)
|
||||
|
||||
with patch.object(module_hass_config, "YAML_CONFIG_FILE", new_yaml_config_file):
|
||||
await hass.services.async_call(
|
||||
|
Loading…
x
Reference in New Issue
Block a user