mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Merge multiple context managers in tests (#48146)
This commit is contained in:
@@ -254,14 +254,15 @@ async def test_setup_config_ssl(
|
||||
config = {"influxdb": config_base.copy()}
|
||||
config["influxdb"].update(config_ext)
|
||||
|
||||
with patch("os.access", return_value=True):
|
||||
with patch("os.path.isfile", return_value=True):
|
||||
assert await async_setup_component(hass, influxdb.DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
with patch("os.access", return_value=True), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
):
|
||||
assert await async_setup_component(hass, influxdb.DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.bus.listen.called
|
||||
assert hass.bus.listen.call_args_list[0][0][0] == EVENT_STATE_CHANGED
|
||||
assert expected_client_args.items() <= mock_client.call_args.kwargs.items()
|
||||
assert hass.bus.listen.called
|
||||
assert hass.bus.listen.call_args_list[0][0][0] == EVENT_STATE_CHANGED
|
||||
assert expected_client_args.items() <= mock_client.call_args.kwargs.items()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user