Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/components/filesize/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestFileSensor(unittest.TestCase):
def setup_method(self, method):
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.hass.config.whitelist_external_dirs = set((TEST_DIR))
self.hass.config.whitelist_external_dirs = {TEST_DIR}

def teardown_method(self, method):
"""Stop everything that was started."""
Expand Down
2 changes: 1 addition & 1 deletion tests/components/folder/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def setup_method(self, method):
self.hass = get_test_home_assistant()
if not os.path.isdir(TEST_DIR):
os.mkdir(TEST_DIR)
self.hass.config.whitelist_external_dirs = set((TEST_DIR))
self.hass.config.whitelist_external_dirs = {TEST_DIR}

def teardown_method(self, method):
"""Stop everything that was started."""
Expand Down
2 changes: 1 addition & 1 deletion tests/components/folder_watcher/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def test_invalid_path_setup(hass):
async def test_valid_path_setup(hass):
"""Test that a valid path is setup."""
cwd = os.path.join(os.path.dirname(__file__))
hass.config.whitelist_external_dirs = set((cwd))
hass.config.whitelist_external_dirs = {cwd}
with patch.object(folder_watcher, "Watcher"):
assert await async_setup_component(
hass,
Expand Down
8 changes: 3 additions & 5 deletions tests/components/homekit_controller/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ def test_valid_pairing_codes(pairing_code):
def get_flow_context(hass, result):
"""Get the flow context from the result of async_init or async_configure."""
flow = next(
(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)

return flow["context"]
Expand Down
8 changes: 3 additions & 5 deletions tests/components/homematicip_cloud/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ async def test_flow_works(hass, simple_mock_home):
assert result["errors"] == {"base": "press_the_button"}

flow = next(
(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "ABC123"

Expand Down
16 changes: 6 additions & 10 deletions tests/components/hue/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ async def test_flow_works(hass):
assert result["step_id"] == "link"

flow = next(
(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "aabbccddeeff"

Expand Down Expand Up @@ -168,11 +166,9 @@ async def test_flow_two_bridges_discovered_one_new(hass, aioclient_mock):
assert result["type"] == "form"
assert result["step_id"] == "link"
flow = next(
(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "beer"

Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def test_async_track_states(hass):
def test_call_to_component(hass):
"""Test calls to components state reproduction functions."""
with patch(
("homeassistant.components.media_player.reproduce_state.async_reproduce_states")
"homeassistant.components.media_player.reproduce_state.async_reproduce_states"
) as media_player_fun:
media_player_fun.return_value = asyncio.Future()
media_player_fun.return_value.set_result(None)

with patch(
("homeassistant.components.climate.reproduce_state.async_reproduce_states")
"homeassistant.components.climate.reproduce_state.async_reproduce_states"
) as climate_fun:
climate_fun.return_value = asyncio.Future()
climate_fun.return_value.set_result(None)
Expand Down